diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-27 11:57:55 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-27 11:57:55 +0300 |
commit | ddf4d6af51af79746875b4cf0e21d2daacb7d5dc (patch) | |
tree | c10fec1281cfc38c71875f528be1d8aa675d3ac5 /src/app.c | |
parent | fa7b58161699847bcd367d56e2634e1f8fbfbc80 (diff) |
Window: Fixed regressions in retaining window placement
Window placement was not restored correctly when the window was maximized. Maximizing a window (on Windows) causes a spurious move event to be received from SDL, and that would mess up the remembered position. Now window placemenet is saved after a run through the event loop, so the rest of the window messages have been handled.
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -190,7 +190,10 @@ static iString *serializePrefs_App_(const iApp *d) { | |||
190 | a moment to animate to its maximized size. */ | 190 | a moment to animate to its maximized size. */ |
191 | #if defined (LAGRANGE_ENABLE_CUSTOM_FRAME) | 191 | #if defined (LAGRANGE_ENABLE_CUSTOM_FRAME) |
192 | if (snap_MainWindow(d->window)) { | 192 | if (snap_MainWindow(d->window)) { |
193 | if (~SDL_GetWindowFlags(d->window->base.win) & SDL_WINDOW_MINIMIZED) { | 193 | if (snap_MainWindow(d->window) == maximized_WindowSnap) { |
194 | appendFormat_String(str, "~window.maximize\n"); | ||
195 | } | ||
196 | else if (~SDL_GetWindowFlags(d->window->base.win) & SDL_WINDOW_MINIMIZED) { | ||
194 | /* Save the actual visible window position, too, because snapped windows may | 197 | /* Save the actual visible window position, too, because snapped windows may |
195 | still be resized/moved without affecting normalRect. */ | 198 | still be resized/moved without affecting normalRect. */ |
196 | SDL_GetWindowPosition(d->window->base.win, &x, &y); | 199 | SDL_GetWindowPosition(d->window->base.win, &x, &y); |
@@ -1501,7 +1504,7 @@ iBool forceSoftwareRender_App(void) { | |||
1501 | } | 1504 | } |
1502 | 1505 | ||
1503 | void setForceSoftwareRender_App(iBool sw) { | 1506 | void setForceSoftwareRender_App(iBool sw) { |
1504 | app_.forceSoftwareRender = sw; | 1507 | app_.forceSoftwareRender = sw; |
1505 | } | 1508 | } |
1506 | 1509 | ||
1507 | enum iColorTheme colorTheme_App(void) { | 1510 | enum iColorTheme colorTheme_App(void) { |