summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/app.c b/src/app.c
index 90ad271d..b50321b2 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1112,14 +1112,24 @@ iBool handleCommand_App(const char *cmd) {
1112 return iTrue; 1112 return iTrue;
1113 } 1113 }
1114 else if (equal_Command(cmd, "window.maximize")) { 1114 else if (equal_Command(cmd, "window.maximize")) {
1115 SDL_MaximizeWindow(d->window->win); 1115 if (!argLabel_Command(cmd, "toggle")) {
1116 SDL_MaximizeWindow(d->window->win);
1117 }
1118 else {
1119 if (SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_MAXIMIZED) {
1120 SDL_RestoreWindow(d->window->win);
1121 }
1122 else {
1123 SDL_MaximizeWindow(d->window->win);
1124 }
1125 }
1116 return iTrue; 1126 return iTrue;
1117 } 1127 }
1118 else if (equal_Command(cmd, "window.fullscreen")) { 1128 else if (equal_Command(cmd, "window.fullscreen")) {
1119 SDL_SetWindowFullscreen(d->window->win, 1129 const iBool wasFull =
1120 SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_FULLSCREEN_DESKTOP 1130 (SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0;
1121 ? 0 1131 SDL_SetWindowFullscreen(d->window->win, wasFull ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP);
1122 : SDL_WINDOW_FULLSCREEN_DESKTOP); 1132 postCommandf_App("window.fullscreen.changed arg:%d", !wasFull);
1123 return iTrue; 1133 return iTrue;
1124 } 1134 }
1125 else if (equal_Command(cmd, "font.set")) { 1135 else if (equal_Command(cmd, "font.set")) {