diff options
-rw-r--r-- | src/app.c | 1 | ||||
-rw-r--r-- | src/ui/window.c | 8 | ||||
-rw-r--r-- | src/ui/window.h | 1 |
3 files changed, 8 insertions, 2 deletions
@@ -340,6 +340,7 @@ static void saveState_App_(const iApp *d) { | |||
340 | #if defined (LAGRANGE_IDLE_SLEEP) | 340 | #if defined (LAGRANGE_IDLE_SLEEP) |
341 | static uint32_t checkAsleep_App_(uint32_t interval, void *param) { | 341 | static uint32_t checkAsleep_App_(uint32_t interval, void *param) { |
342 | iApp *d = param; | 342 | iApp *d = param; |
343 | iUnused(d); | ||
343 | SDL_Event ev = { .type = SDL_USEREVENT }; | 344 | SDL_Event ev = { .type = SDL_USEREVENT }; |
344 | ev.user.code = asleep_UserEventCode; | 345 | ev.user.code = asleep_UserEventCode; |
345 | SDL_PushEvent(&ev); | 346 | SDL_PushEvent(&ev); |
diff --git a/src/ui/window.c b/src/ui/window.c index f8123a17..6d697e88 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -827,6 +827,10 @@ static iBool isMaximized_Window_(const iWindow *d) { | |||
827 | #endif | 827 | #endif |
828 | } | 828 | } |
829 | 829 | ||
830 | iBool isFullscreen_Window(const iWindow *d) { | ||
831 | return (SDL_GetWindowFlags(d->win) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; | ||
832 | } | ||
833 | |||
830 | static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { | 834 | static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { |
831 | switch (ev->event) { | 835 | switch (ev->event) { |
832 | case SDL_WINDOWEVENT_EXPOSED: | 836 | case SDL_WINDOWEVENT_EXPOSED: |
@@ -845,7 +849,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { | |||
845 | #endif | 849 | #endif |
846 | return iFalse; | 850 | return iFalse; |
847 | case SDL_WINDOWEVENT_MOVED: { | 851 | case SDL_WINDOWEVENT_MOVED: { |
848 | if (!isMaximized_Window_(d) && !d->isDrawFrozen) { | 852 | if (!isMaximized_Window_(d) && !isFullscreen_Window(d) && !d->isDrawFrozen) { |
849 | d->lastRect.pos = init_I2(ev->data1, ev->data2); | 853 | d->lastRect.pos = init_I2(ev->data1, ev->data2); |
850 | iInt2 border = zero_I2(); | 854 | iInt2 border = zero_I2(); |
851 | #if !defined (iPlatformApple) | 855 | #if !defined (iPlatformApple) |
@@ -856,7 +860,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { | |||
856 | return iTrue; | 860 | return iTrue; |
857 | } | 861 | } |
858 | case SDL_WINDOWEVENT_RESIZED: | 862 | case SDL_WINDOWEVENT_RESIZED: |
859 | if (!isMaximized_Window_(d) && !d->isDrawFrozen) { | 863 | if (!isMaximized_Window_(d) && !isFullscreen_Window(d) && !d->isDrawFrozen) { |
860 | d->lastRect.size = init_I2(ev->data1, ev->data2); | 864 | d->lastRect.size = init_I2(ev->data1, ev->data2); |
861 | } | 865 | } |
862 | updateRootSize_Window_(d, iTrue /* we were already redrawing during the resize */); | 866 | updateRootSize_Window_(d, iTrue /* we were already redrawing during the resize */); |
diff --git a/src/ui/window.h b/src/ui/window.h index 4b6a6e7a..8cadad1b 100644 --- a/src/ui/window.h +++ b/src/ui/window.h | |||
@@ -65,5 +65,6 @@ iInt2 coord_Window (const iWindow *, int x, int y); | |||
65 | iInt2 mouseCoord_Window (const iWindow *); | 65 | iInt2 mouseCoord_Window (const iWindow *); |
66 | uint32_t frameTime_Window (const iWindow *); | 66 | uint32_t frameTime_Window (const iWindow *); |
67 | SDL_Renderer *renderer_Window (const iWindow *); | 67 | SDL_Renderer *renderer_Window (const iWindow *); |
68 | iBool isFullscreen_Window (const iWindow *); | ||
68 | 69 | ||
69 | iWindow * get_Window (void); | 70 | iWindow * get_Window (void); |