Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions QuickView/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ static EditState g_editState;
AppConfig g_config;
RuntimeConfig g_runtime;
ViewState g_viewState; // Non-static for extern access from UIRenderer
bool g_preserveViewStateOnNextLoad = false;
ViewState g_preservedViewState;
static int g_renderExifOrientation = 1; // Exif orientation baked into the bitmap surface
FileNavigator g_navigator; // New Navigator (Non-static for extern access from SettingsOverlay)
static ThumbnailManager g_thumbMgr;
Expand Down Expand Up @@ -8586,6 +8588,8 @@ SKIP_EDGE_NAV:;
g_imageEngine->UpdateConfig(g_runtime); // [Fix] Push config to engine
g_imageEngine->SetForceRefresh(true);
}
g_preservedViewState = g_viewState;
g_preserveViewStateOnNextLoad = true;
ReleaseImageResources();
LoadImageAsync(hwnd, contextPath.c_str());
}
Expand Down Expand Up @@ -8613,6 +8617,8 @@ SKIP_EDGE_NAV:;
g_imageEngine->UpdateConfig(g_runtime);
g_imageEngine->SetForceRefresh(true);
}
g_preservedViewState = g_viewState;
g_preserveViewStateOnNextLoad = true;
ReleaseImageResources();
LoadImageAsync(hwnd, g_imagePath, false, QuickView::BrowseDirection::IDLE);
}
Expand Down Expand Up @@ -9211,6 +9217,15 @@ void ProcessEngineEvents(HWND hwnd) {
ApplyFullScreenZoomMode(hwnd);
}

// [Fix] Restore View State if it was saved prior to reloading (e.g. Color Space switch)
// Do this before SyncDCompState so it receives the correct zoom and pan
if (g_preserveViewStateOnNextLoad) {
g_viewState.Zoom = g_preservedViewState.Zoom;
g_viewState.PanX = g_preservedViewState.PanX;
g_viewState.PanY = g_preservedViewState.PanY;
g_preserveViewStateOnNextLoad = false; // Consume it
}

// [Fix] Explicitly Sync DComp State immediately after Window Adjustment
// This covers the case where the Window Size DOES NOT CHANGE (e.g. Locked or Maximized),
// so WM_SIZE is never fired, leaving the DComp Transform Matrix stale (using old image AR).
Expand Down