Skip to content

Commit 7ff6f2a

Browse files
committed
fix: resolve persistent window placement and initial resize overwrite #176
1 parent 3866c32 commit 7ff6f2a

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

QuickView/QuickView.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
// Version Information - This sets the display name in Windows
1212
VS_VERSION_INFO VERSIONINFO
13-
FILEVERSION 6,0,1,9
14-
PRODUCTVERSION 6,0,1,9
13+
FILEVERSION 6,0,1,10
14+
PRODUCTVERSION 6,0,1,10
1515
FILEFLAGSMASK 0x3fL
1616
FILEFLAGS 0x0L
1717
FILEOS VOS_NT_WINDOWS32
@@ -24,11 +24,11 @@ BEGIN
2424
BEGIN
2525
VALUE "CompanyName", "QuickView"
2626
VALUE "FileDescription", "QuickView"
27-
VALUE "FileVersion", "6.0.1.9"
27+
VALUE "FileVersion", "6.0.1.10"
2828
VALUE "InternalName", "QuickView"
2929
VALUE "OriginalFilename", "QuickView.exe"
3030
VALUE "ProductName", "QuickView"
31-
VALUE "ProductVersion", "6.0.1.9"
31+
VALUE "ProductVersion", "6.0.1.10"
3232
END
3333
END
3434
BLOCK "VarFileInfo"

QuickView/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ CRenderEngine* g_pRenderEngine = nullptr; // Global raw alias for linker compati
187187

188188
bool g_isFullScreen = false;
189189
bool g_isDraggingAnimSeek = false;
190+
bool g_windowSizeRestoredFromConfig = false;
190191
static WINDOWPLACEMENT g_savedWindowPlacement = { sizeof(WINDOWPLACEMENT), 0, 0, {0,0}, {0,0}, {0,0,0,0} };
191192

192193
namespace {
@@ -6019,6 +6020,17 @@ void AdjustWindowForOverlay(HWND hwnd, bool isClosed) {
60196020
void AdjustWindowToImage(HWND hwnd) {
60206021
s_restoredWindowRect = {}; // Clear restored rect so new image sets new initial size
60216022
if (!g_imageResource) return;
6023+
6024+
// [Fix] If window size was restored from config, skip the initial auto-resize to fit the image.
6025+
// This ensures the window stays at the user's saved dimensions on startup.
6026+
// Subsequent navigation (Next/Prev) will still trigger auto-resize unless KeepWindowSizeOnNav is ON.
6027+
static bool s_initialLoadProcessed = false;
6028+
if (g_config.RememberLastWindowSizeAndPosition && !s_initialLoadProcessed && g_windowSizeRestoredFromConfig) {
6029+
s_initialLoadProcessed = true;
6030+
return;
6031+
}
6032+
s_initialLoadProcessed = true;
6033+
60226034
if (g_runtime.LockWindowSize && g_config.KeepWindowSizeOnNav) return; // Don't auto-resize when locked and requested to keep size
60236035

60246036
// Note: Removed early return for g_settingsOverlay.IsVisible() because GetMinWindowWidth()
@@ -7075,6 +7087,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, [[maybe_unused]] LPWSTR lpCm
70757087
if (savedW > 0 && savedH > 0) {
70767088
winW = savedW;
70777089
winH = savedH;
7090+
g_windowSizeRestoredFromConfig = true;
70787091
}
70797092

70807093
if (savedX != -10000 && savedY != -10000) {

0 commit comments

Comments
 (0)