summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app.c1
-rw-r--r--src/ui/window.c8
-rw-r--r--src/ui/window.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/app.c b/src/app.c
index 6f50ca7b..c2b95bdb 100644
--- a/src/app.c
+++ b/src/app.c
@@ -340,6 +340,7 @@ static void saveState_App_(const iApp *d) {
340#if defined (LAGRANGE_IDLE_SLEEP) 340#if defined (LAGRANGE_IDLE_SLEEP)
341static uint32_t checkAsleep_App_(uint32_t interval, void *param) { 341static 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
830iBool isFullscreen_Window(const iWindow *d) {
831 return (SDL_GetWindowFlags(d->win) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0;
832}
833
830static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { 834static 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);
65iInt2 mouseCoord_Window (const iWindow *); 65iInt2 mouseCoord_Window (const iWindow *);
66uint32_t frameTime_Window (const iWindow *); 66uint32_t frameTime_Window (const iWindow *);
67SDL_Renderer *renderer_Window (const iWindow *); 67SDL_Renderer *renderer_Window (const iWindow *);
68iBool isFullscreen_Window (const iWindow *);
68 69
69iWindow * get_Window (void); 70iWindow * get_Window (void);