From 2f3fa20d07d86c56e3e3d054339e0b02ef577c4b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 4 Oct 2020 17:30:05 +0300 Subject: Fixed window position retain error At least on macOS, there is a stray window move event during app launch that causes the wrong position to be saved. At launch, the window position comes from preferences. --- src/ui/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/window.c b/src/ui/window.c index 7d368f42..aac2405c 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -636,7 +636,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { return iFalse; #endif case SDL_WINDOWEVENT_MOVED: { - if (!isMaximized_Window_(d)) { + if (!isMaximized_Window_(d) && !d->isDrawFrozen) { d->lastRect.pos = init_I2(ev->data1, ev->data2); iInt2 border = zero_I2(); #if !defined (iPlatformApple) @@ -648,7 +648,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { } case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_SIZE_CHANGED: - if (!isMaximized_Window_(d)) { + if (!isMaximized_Window_(d) && !d->isDrawFrozen) { d->lastRect.size = init_I2(ev->data1, ev->data2); } updateRootSize_Window_(d); -- cgit v1.2.3