From 1dd3a602d77982ffd9eebecbffd246dda08bf8e6 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 15 Sep 2020 20:47:04 +1000 Subject: [PATCH] Support Un/Fullscreen --- v2/internal/ffenestri/ffenestri_darwin.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/v2/internal/ffenestri/ffenestri_darwin.c b/v2/internal/ffenestri/ffenestri_darwin.c index 3e4f9c50d..5391b7303 100644 --- a/v2/internal/ffenestri/ffenestri_darwin.c +++ b/v2/internal/ffenestri/ffenestri_darwin.c @@ -188,18 +188,24 @@ void SetTitle(void *appPointer, const char *title) { void fullscreenInternal(void *appPointer) { Debug("Fullscreen Called"); struct Application *app = (struct Application*) appPointer; + app->fullscreen = !app->fullscreen; msg(app->mainWindow, s("toggleFullScreen:")); } // Fullscreen sets the main window to be fullscreen void Fullscreen(void *appPointer) { - execOnMainThread(appPointer, fullscreenInternal, NULL); + struct Application *app = (struct Application*) appPointer; + if( app->fullscreen == 0) { + execOnMainThread(appPointer, fullscreenInternal, NULL); + } } // UnFullscreen resets the main window after a fullscreen void UnFullscreen(void *appPointer) { Debug("UnFullscreen Called"); - // struct Application *app = (struct Application*) appPointer; - // gtk_window_unfullscreen (app->mainWindow); + struct Application *app = (struct Application*) appPointer; + if( app->fullscreen == 1) { + execOnMainThread(appPointer, fullscreenInternal, NULL); + } } void Center(void *appPointer) {