From eed3245b1b390c5d70600714d4fcb0308f84c97d Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Fri, 19 Jun 2009 17:30:37 +0200 Subject: [PATCH] Add a switch to disable autofullscreen'ing maximized windows without decorations --- src/core/constraints.c | 4 +++- src/core/main.c | 10 ++++++++++ src/core/prefs.c | 17 +++++++++++++++++ src/include/prefs.h | 6 +++++- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/core/constraints.c b/src/core/constraints.c index a6b334421..39a96eede 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -27,6 +27,7 @@ #include "constraints.h" #include "workspace-private.h" #include "place.h" +#include "prefs.h" #include #include @@ -424,7 +425,8 @@ setup_constraint_info (ConstraintInfo *info, /* Workaround braindead legacy apps that don't know how to * fullscreen themselves properly. */ - if (meta_rectangle_equal (new, &monitor_info->rect) && + if (meta_prefs_get_force_fullscreen() && + meta_rectangle_equal (new, &monitor_info->rect) && window->has_fullscreen_func && !window->fullscreen) { diff --git a/src/core/main.c b/src/core/main.c index 1e0cac200..e136617df 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -228,6 +228,7 @@ typedef struct gboolean sync; gboolean composite; gboolean no_composite; + gboolean no_force_fullscreen; gboolean no_tab_popup; gchar *introspect; } MetaArguments; @@ -306,6 +307,12 @@ meta_parse_options (int *argc, char ***argv, N_("Turn compositing off"), NULL }, + { + "no-force-fullscreen", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, + &my_args.no_force_fullscreen, + N_("Don't make fullscreen windows that are maximized and have no decorations"), + NULL + }, { "mutter-plugins", 0, 0, G_OPTION_ARG_STRING, &my_args.mutter_plugins, @@ -677,6 +684,9 @@ main (int argc, char **argv) if (meta_args.composite || meta_args.no_composite) meta_prefs_set_compositing_manager (meta_args.composite); + if (meta_args.no_force_fullscreen) + meta_prefs_set_force_fullscreen (FALSE); + if (meta_args.no_tab_popup) { meta_prefs_override_no_tab_popup (TRUE); diff --git a/src/core/prefs.c b/src/core/prefs.c index a8fd3fe8c..b5c01ba77 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -100,6 +100,7 @@ static char *cursor_theme = NULL; static int cursor_size = 24; static gboolean compositing_manager = FALSE; static gboolean resize_with_right_button = FALSE; +static gboolean force_fullscreen = TRUE; static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH; static MetaButtonLayout button_layout; @@ -1800,6 +1801,9 @@ meta_preference_to_string (MetaPreference pref) case META_PREF_RESIZE_WITH_RIGHT_BUTTON: return "RESIZE_WITH_RIGHT_BUTTON"; + case META_PREF_FORCE_FULLSCREEN: + return "FORCE_FULLSCREEN"; + case META_PREF_CLUTTER_PLUGINS: return "CLUTTER_PLUGINS"; @@ -2792,6 +2796,12 @@ meta_prefs_get_mouse_button_menu (void) return resize_with_right_button ? 2: 3; } +gboolean +meta_prefs_get_force_fullscreen (void) +{ + return force_fullscreen; +} + void meta_prefs_set_compositing_manager (gboolean whether) { @@ -2957,3 +2967,10 @@ init_button_layout(void) }; #endif + +void +meta_prefs_set_force_fullscreen (gboolean whether) +{ + force_fullscreen = whether; +} + diff --git a/src/include/prefs.h b/src/include/prefs.h index aaaa8fe8e..af0a01c02 100644 --- a/src/include/prefs.h +++ b/src/include/prefs.h @@ -59,9 +59,10 @@ typedef enum META_PREF_CURSOR_SIZE, META_PREF_COMPOSITING_MANAGER, META_PREF_RESIZE_WITH_RIGHT_BUTTON, + META_PREF_FORCE_FULLSCREEN, META_PREF_CLUTTER_PLUGINS, META_PREF_LIVE_HIDDEN_WINDOWS, - META_PREF_NO_TAB_POPUP, + META_PREF_NO_TAB_POPUP } MetaPreference; typedef void (* MetaPrefsChangedFunc) (MetaPreference pref, @@ -115,6 +116,7 @@ void meta_prefs_change_workspace_name (int i, const char* meta_prefs_get_cursor_theme (void); int meta_prefs_get_cursor_size (void); gboolean meta_prefs_get_compositing_manager (void); +gboolean meta_prefs_get_force_fullscreen (void); /** * Sets whether the compositor is turned on. @@ -123,6 +125,8 @@ gboolean meta_prefs_get_compositing_manager (void); */ void meta_prefs_set_compositing_manager (gboolean whether); +void meta_prefs_set_force_fullscreen (gboolean whether); + GSList * meta_prefs_get_clutter_plugins (void); /**