mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
disable decoration on mobile compositors by default
On mobile compositors like Phosh, the title bar will have no buttons and is useless. Therefore it can be disabled by default. This behaviour can still be overwritten using the ATL_DISABLE_WINDOW_DECORATIONS environment variable.
This commit is contained in:
parent
b413f67932
commit
0bec10bb26
1 changed files with 10 additions and 2 deletions
|
@ -401,8 +401,16 @@ static void open(GtkApplication *app, GFile **files, gint nfiles, const gchar *h
|
|||
|
||||
window = gtk_application_window_new(app);
|
||||
|
||||
if (getenv("ATL_DISABLE_WINDOW_DECORATIONS"))
|
||||
gtk_window_set_decorated(GTK_WINDOW(window), 0);
|
||||
const char *disable_decoration_env = getenv("ATL_DISABLE_WINDOW_DECORATIONS");
|
||||
gboolean decorated;
|
||||
if (disable_decoration_env)
|
||||
decorated = !strcmp(disable_decoration_env, "0") || !strcmp(disable_decoration_env, "false");
|
||||
else { // by default only enable decorations if there are any action buttons to show in the title bar
|
||||
const char *decoration_layout;
|
||||
g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-decoration-layout", &decoration_layout, NULL);
|
||||
decorated = strcmp(decoration_layout, "") && strcmp(decoration_layout, "menu");
|
||||
}
|
||||
gtk_window_set_decorated(GTK_WINDOW(window), decorated);
|
||||
|
||||
if (getenv("ATL_FORCE_FULLSCREEN"))
|
||||
gtk_window_fullscreen(GTK_WINDOW(window));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue