diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-04 17:30:05 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-04 17:30:05 +0300 |
commit | 2f3fa20d07d86c56e3e3d054339e0b02ef577c4b (patch) | |
tree | fbfb36073c0e59b5781058afdce72ad2fe8a830a /src/ui | |
parent | efb40105d657da935d3854e6ea7a513c6210224b (diff) |
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.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/window.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { | |||
636 | return iFalse; | 636 | return iFalse; |
637 | #endif | 637 | #endif |
638 | case SDL_WINDOWEVENT_MOVED: { | 638 | case SDL_WINDOWEVENT_MOVED: { |
639 | if (!isMaximized_Window_(d)) { | 639 | if (!isMaximized_Window_(d) && !d->isDrawFrozen) { |
640 | d->lastRect.pos = init_I2(ev->data1, ev->data2); | 640 | d->lastRect.pos = init_I2(ev->data1, ev->data2); |
641 | iInt2 border = zero_I2(); | 641 | iInt2 border = zero_I2(); |
642 | #if !defined (iPlatformApple) | 642 | #if !defined (iPlatformApple) |
@@ -648,7 +648,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { | |||
648 | } | 648 | } |
649 | case SDL_WINDOWEVENT_RESIZED: | 649 | case SDL_WINDOWEVENT_RESIZED: |
650 | case SDL_WINDOWEVENT_SIZE_CHANGED: | 650 | case SDL_WINDOWEVENT_SIZE_CHANGED: |
651 | if (!isMaximized_Window_(d)) { | 651 | if (!isMaximized_Window_(d) && !d->isDrawFrozen) { |
652 | d->lastRect.size = init_I2(ev->data1, ev->data2); | 652 | d->lastRect.size = init_I2(ev->data1, ev->data2); |
653 | } | 653 | } |
654 | updateRootSize_Window_(d); | 654 | updateRootSize_Window_(d); |