From 78c966321a23b5c47e7800fb5613cf5a5d5e9ab8 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sun, 1 Jul 2012 19:25:08 +0200 Subject: [PATCH] prefs: add get_/set_ignore_request_hide_titlebar () Enables the possibility to ignore GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED to prevent hiding the titlebar of applications even if they requested so. https://bugzilla.gnome.org/show_bug.cgi?id=678947 --- src/core/prefs.c | 13 +++++++++++++ src/core/window-props.c | 2 +- src/meta/prefs.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/prefs.c b/src/core/prefs.c index 3f3050dfc..bbd348433 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -96,6 +96,7 @@ static int draggable_border_width = 10; static gboolean resize_with_right_button = FALSE; static gboolean edge_tiling = FALSE; static gboolean force_fullscreen = TRUE; +static gboolean ignore_request_hide_titlebar = FALSE; static GDesktopVisualBellType visual_bell_type = G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH; static MetaButtonLayout button_layout; @@ -2149,3 +2150,15 @@ meta_prefs_set_force_fullscreen (gboolean whether) { force_fullscreen = whether; } + +gboolean +meta_prefs_get_ignore_request_hide_titlebar (void) +{ + return ignore_request_hide_titlebar; +} + +void +meta_prefs_set_ignore_request_hide_titlebar (gboolean whether) +{ + ignore_request_hide_titlebar = whether; +} diff --git a/src/core/window-props.c b/src/core/window-props.c index 1f5f04525..e08c89cdd 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -1600,7 +1600,7 @@ reload_gtk_hide_titlebar_when_maximized (MetaWindow *window, gboolean requested_value = FALSE; gboolean current_value = window->hide_titlebar_when_maximized; - if (value->type != META_PROP_VALUE_INVALID) + if (!meta_prefs_get_ignore_request_hide_titlebar () && value->type != META_PROP_VALUE_INVALID) { requested_value = ((int) value->v.cardinal == 1); meta_verbose ("Request to hide titlebar for window %s.\n", window->desc); diff --git a/src/meta/prefs.h b/src/meta/prefs.h index e72690afe..156f72862 100644 --- a/src/meta/prefs.h +++ b/src/meta/prefs.h @@ -131,6 +131,9 @@ void meta_prefs_set_no_tab_popup (gboolean whether); int meta_prefs_get_draggable_border_width (void); +gboolean meta_prefs_get_ignore_request_hide_titlebar (void); +void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether); + /* XXX FIXME This should be x-macroed, but isn't yet because it would be * difficult (or perhaps impossible) to add the suffixes using the current * system. It needs some more thought, perhaps after the current system