Add a switch to disable autofullscreen'ing maximized windows without decorations

This commit is contained in:
Tomeu Vizoso 2009-06-19 17:30:37 +02:00 committed by Owen W. Taylor
parent a7bbde1699
commit eed3245b1b
4 changed files with 35 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include "constraints.h" #include "constraints.h"
#include "workspace-private.h" #include "workspace-private.h"
#include "place.h" #include "place.h"
#include "prefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
@ -424,7 +425,8 @@ setup_constraint_info (ConstraintInfo *info,
/* Workaround braindead legacy apps that don't know how to /* Workaround braindead legacy apps that don't know how to
* fullscreen themselves properly. * 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->has_fullscreen_func &&
!window->fullscreen) !window->fullscreen)
{ {

View File

@ -228,6 +228,7 @@ typedef struct
gboolean sync; gboolean sync;
gboolean composite; gboolean composite;
gboolean no_composite; gboolean no_composite;
gboolean no_force_fullscreen;
gboolean no_tab_popup; gboolean no_tab_popup;
gchar *introspect; gchar *introspect;
} MetaArguments; } MetaArguments;
@ -306,6 +307,12 @@ meta_parse_options (int *argc, char ***argv,
N_("Turn compositing off"), N_("Turn compositing off"),
NULL 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, "mutter-plugins", 0, 0, G_OPTION_ARG_STRING,
&my_args.mutter_plugins, &my_args.mutter_plugins,
@ -677,6 +684,9 @@ main (int argc, char **argv)
if (meta_args.composite || meta_args.no_composite) if (meta_args.composite || meta_args.no_composite)
meta_prefs_set_compositing_manager (meta_args.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) if (meta_args.no_tab_popup)
{ {
meta_prefs_override_no_tab_popup (TRUE); meta_prefs_override_no_tab_popup (TRUE);

View File

@ -100,6 +100,7 @@ static char *cursor_theme = NULL;
static int cursor_size = 24; static int cursor_size = 24;
static gboolean compositing_manager = FALSE; static gboolean compositing_manager = FALSE;
static gboolean resize_with_right_button = FALSE; static gboolean resize_with_right_button = FALSE;
static gboolean force_fullscreen = TRUE;
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH; static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
static MetaButtonLayout button_layout; static MetaButtonLayout button_layout;
@ -1800,6 +1801,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_RESIZE_WITH_RIGHT_BUTTON: case META_PREF_RESIZE_WITH_RIGHT_BUTTON:
return "RESIZE_WITH_RIGHT_BUTTON"; return "RESIZE_WITH_RIGHT_BUTTON";
case META_PREF_FORCE_FULLSCREEN:
return "FORCE_FULLSCREEN";
case META_PREF_CLUTTER_PLUGINS: case META_PREF_CLUTTER_PLUGINS:
return "CLUTTER_PLUGINS"; return "CLUTTER_PLUGINS";
@ -2792,6 +2796,12 @@ meta_prefs_get_mouse_button_menu (void)
return resize_with_right_button ? 2: 3; return resize_with_right_button ? 2: 3;
} }
gboolean
meta_prefs_get_force_fullscreen (void)
{
return force_fullscreen;
}
void void
meta_prefs_set_compositing_manager (gboolean whether) meta_prefs_set_compositing_manager (gboolean whether)
{ {
@ -2957,3 +2967,10 @@ init_button_layout(void)
}; };
#endif #endif
void
meta_prefs_set_force_fullscreen (gboolean whether)
{
force_fullscreen = whether;
}

View File

@ -59,9 +59,10 @@ typedef enum
META_PREF_CURSOR_SIZE, META_PREF_CURSOR_SIZE,
META_PREF_COMPOSITING_MANAGER, META_PREF_COMPOSITING_MANAGER,
META_PREF_RESIZE_WITH_RIGHT_BUTTON, META_PREF_RESIZE_WITH_RIGHT_BUTTON,
META_PREF_FORCE_FULLSCREEN,
META_PREF_CLUTTER_PLUGINS, META_PREF_CLUTTER_PLUGINS,
META_PREF_LIVE_HIDDEN_WINDOWS, META_PREF_LIVE_HIDDEN_WINDOWS,
META_PREF_NO_TAB_POPUP, META_PREF_NO_TAB_POPUP
} MetaPreference; } MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref, 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); const char* meta_prefs_get_cursor_theme (void);
int meta_prefs_get_cursor_size (void); int meta_prefs_get_cursor_size (void);
gboolean meta_prefs_get_compositing_manager (void); gboolean meta_prefs_get_compositing_manager (void);
gboolean meta_prefs_get_force_fullscreen (void);
/** /**
* Sets whether the compositor is turned on. * 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_compositing_manager (gboolean whether);
void meta_prefs_set_force_fullscreen (gboolean whether);
GSList * meta_prefs_get_clutter_plugins (void); GSList * meta_prefs_get_clutter_plugins (void);
/** /**