diff --git a/unix/window.c b/unix/window.c index f0d88be4..8b953a4a 100644 --- a/unix/window.c +++ b/unix/window.c @@ -28,6 +28,7 @@ struct uiWindow { void (*onContentSizeChanged)(uiWindow *, void *); void *onContentSizeChangedData; gboolean changingSize; + gboolean fullscreen; }; static gboolean onClosing(GtkWidget *win, GdkEvent *e, gpointer data) @@ -212,6 +213,22 @@ void uiWindowSetContentSize(uiWindow *w, int width, int height) gtk_widget_set_size_request(w->childHolderWidget, -1, -1); } +int uiWindowFullscreen(uiWindow *w) +{ + return w->fullscreen; +} + +// TODO use window-state-event to track +// TODO does this send an extra size changed? +void uiWindowSetFullscreen(uiWindow *w, int fullscreen) +{ + w->fullscreen = fullscreen; + if (w->fullscreen) + gtk_window_fullscreen(w->window); + else + gtk_window_unfullscreen(w->window); +} + void uiWindowOnContentSizeChanged(uiWindow *w, void (*f)(uiWindow *, void *), void *data) { w->onContentSizeChanged = f;