Skip to content
Merged
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
25 changes: 20 additions & 5 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 @@ -9204,11 +9210,20 @@ void ProcessEngineEvents(HWND hwnd) {

// [Fix] Update Window Size AFTER RenderImageToDComp
// This ensures g_lastSurfaceSize is updated with the NEW image dimensions.
AdjustWindowToImage(hwnd);

// [Feature] Apply Fullscreen Zoom Mode if active
if (g_isFullScreen || IsZoomed(hwnd)) {
ApplyFullScreenZoomMode(hwnd);
// If we are preserving view state (e.g., Color Space switch), we DO NOT resize the window
// and we bypass the Fullscreen zoom mode reset, ensuring exact visual continuity.
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
} else {
AdjustWindowToImage(hwnd);

// [Feature] Apply Fullscreen Zoom Mode if active
if (g_isFullScreen || IsZoomed(hwnd)) {
ApplyFullScreenZoomMode(hwnd);
}
}

// [Fix] Explicitly Sync DComp State immediately after Window Adjustment
Expand Down