From 49436ef172e01e70cee6b2b5022082899ce784c3 Mon Sep 17 00:00:00 2001 From: Mis012 Date: Thu, 21 Mar 2024 21:11:26 +0100 Subject: [PATCH] main: add ATL_FORCE_FULLSCREEN env --- doc/Envs.md | 3 ++- src/main-executable/main.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Envs.md b/doc/Envs.md index b22bfdc6..41c3e34f 100644 --- a/doc/Envs.md +++ b/doc/Envs.md @@ -6,4 +6,5 @@ The following environment variables are recognized by the main executable: `ATL_DISABLE_WINDOW_DECORATIONS=` - if set, window decorations will be disabled; this is useful for saving screen space on phone screens, as well as working around the fact that we currently don't account for the titlebar when passing screen size to apps `ATL_UGLY_ENABLE_LOCATION=` - if set, apps will be able to get location data using the relevant android APIs. (TODO: use bubblewrap) -`UGLY_HACK_FOR_VR` - if set, EGL will use XWayland display on Wayland. This means the app won't be able to draw to it's window, but it will be able to use pbuffers which are not available on wayland. +`UGLY_HACK_FOR_VR` - if set, EGL will use XWayland display on Wayland. This means the app won't be able to draw to it's window, but it will be able to use pbuffers which are not available on wayland. (TODO: just recommend GDK_BACKEND=x11 if pbuffers are needed?) +`ATL_FORCE_FULLSCREEN` - if set, will fullscreen the app window on start; this is useful for saving screen space on phone screens, as well as making apps that can't handle arbitrary screen dimensions for some reason happier diff --git a/src/main-executable/main.c b/src/main-executable/main.c index 0ced6979..d9b849d3 100644 --- a/src/main-executable/main.c +++ b/src/main-executable/main.c @@ -350,6 +350,9 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h if(getenv("ATL_DISABLE_WINDOW_DECORATIONS")) gtk_window_set_decorated(GTK_WINDOW(window), 0); + if(getenv("ATL_FORCE_FULLSCREEN")) + gtk_window_fullscreen(GTK_WINDOW(window)); + gtk_window_present(GTK_WINDOW(window)); // construct Application