From 0a317cb0e7548f3a07725c15d110544cae3c1b70 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 18 Apr 2021 17:06:01 -0700 Subject: [PATCH] Workaround for egregious window placement behavior Windows is currently creating the main window at near-maximal size. It used to remember the size and placement, but no longer does. As a workaround, the initial size is set to 1150x800, which is large enough to show all columns without scrolling even with very wide pathnames. With some effort this could be modified to respect the maximum size of the monitor on which it will be displayed, so that anyone still running at 1024x768 won't be in a bad place. Ideally it would remember the previous size and position. See issue #41 for discussion. --- app/Main.cpp | 2 ++ app/MyApp.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/app/Main.cpp b/app/Main.cpp index b74b9a6..02700bc 100644 --- a/app/Main.cpp +++ b/app/Main.cpp @@ -311,6 +311,8 @@ BOOL MainWindow::PreCreateWindow(CREATESTRUCT& cs) BOOL res = CFrameWnd::PreCreateWindow(cs); cs.dwExStyle &= ~(WS_EX_CLIENTEDGE); + cs.cx = 1150; + cs.cy = 800; // This changes the window class name to a value that the installer can // detect. This allows us to prevent installation while CiderPress is diff --git a/app/MyApp.cpp b/app/MyApp.cpp index 87dac70..110f91c 100644 --- a/app/MyApp.cpp +++ b/app/MyApp.cpp @@ -47,6 +47,7 @@ MyApp::MyApp() : CWinAppEx() LOGI("Leak detection enabled"); #endif + //EnableLoadWindowPlacement(true); EnableHtmlHelp(); }