| 1 |
From b625ec30d99b2dcf86d8fa78b09f6d04dce3a6e0 Mon Sep 17 00:00:00 2001
|
| 2 |
From: Tomeu Vizoso <tomeu@sugarlabs.org>
|
| 3 |
Date: Fri, 19 Jun 2009 15:30:37 +0000
|
| 4 |
Subject: Add a switch to disable autofullscreen'ing maximized windows without decorations
|
| 5 |
|
| 6 |
---
|
| 7 |
diff --git a/src/core/constraints.c b/src/core/constraints.c
|
| 8 |
index 800b293..a060d20 100644
|
| 9 |
--- a/src/core/constraints.c
|
| 10 |
+++ b/src/core/constraints.c
|
| 11 |
@@ -27,6 +27,7 @@
|
| 12 |
#include "constraints.h"
|
| 13 |
#include "workspace.h"
|
| 14 |
#include "place.h"
|
| 15 |
+#include "prefs.h"
|
| 16 |
|
| 17 |
#include <stdlib.h>
|
| 18 |
#include <math.h>
|
| 19 |
@@ -424,7 +425,8 @@ setup_constraint_info (ConstraintInfo *info,
|
| 20 |
/* Workaround braindead legacy apps that don't know how to
|
| 21 |
* fullscreen themselves properly.
|
| 22 |
*/
|
| 23 |
- if (meta_rectangle_equal (new, &xinerama_info->rect) &&
|
| 24 |
+ if (meta_prefs_get_force_fullscreen() &&
|
| 25 |
+ meta_rectangle_equal (new, &xinerama_info->rect) &&
|
| 26 |
window->has_fullscreen_func &&
|
| 27 |
!window->fullscreen)
|
| 28 |
{
|
| 29 |
diff --git a/src/core/main.c b/src/core/main.c
|
| 30 |
index 6c36f10..a36a396 100644
|
| 31 |
--- a/src/core/main.c
|
| 32 |
+++ b/src/core/main.c
|
| 33 |
@@ -233,6 +233,7 @@ typedef struct
|
| 34 |
gboolean sync;
|
| 35 |
gboolean composite;
|
| 36 |
gboolean no_composite;
|
| 37 |
+ gboolean no_force_fullscreen;
|
| 38 |
} MetaArguments;
|
| 39 |
|
| 40 |
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
| 41 |
@@ -314,6 +315,12 @@ meta_parse_options (int *argc, char ***argv,
|
| 42 |
N_("Turn compositing off"),
|
| 43 |
NULL
|
| 44 |
},
|
| 45 |
+ {
|
| 46 |
+ "no-force-fullscreen", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE,
|
| 47 |
+ &my_args.no_force_fullscreen,
|
| 48 |
+ N_("Don't make fullscreen windows that are maximized and have no decorations"),
|
| 49 |
+ NULL
|
| 50 |
+ },
|
| 51 |
{NULL}
|
| 52 |
};
|
| 53 |
GOptionContext *ctx;
|
| 54 |
@@ -584,6 +591,9 @@ main (int argc, char **argv)
|
| 55 |
if (meta_args.composite || meta_args.no_composite)
|
| 56 |
meta_prefs_set_compositing_manager (meta_args.composite);
|
| 57 |
|
| 58 |
+ if (meta_args.no_force_fullscreen)
|
| 59 |
+ meta_prefs_set_force_fullscreen (FALSE);
|
| 60 |
+
|
| 61 |
if (!meta_display_open ())
|
| 62 |
meta_exit (META_EXIT_ERROR);
|
| 63 |
|
| 64 |
diff --git a/src/core/prefs.c b/src/core/prefs.c
|
| 65 |
index 1f4fe41..6e41b3c 100644
|
| 66 |
--- a/src/core/prefs.c
|
| 67 |
+++ b/src/core/prefs.c
|
| 68 |
@@ -95,6 +95,7 @@ static char *cursor_theme = NULL;
|
| 69 |
static int cursor_size = 24;
|
| 70 |
static gboolean compositing_manager = FALSE;
|
| 71 |
static gboolean resize_with_right_button = FALSE;
|
| 72 |
+static gboolean force_fullscreen = TRUE;
|
| 73 |
|
| 74 |
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
|
| 75 |
static MetaButtonLayout button_layout;
|
| 76 |
@@ -1751,6 +1752,9 @@ meta_preference_to_string (MetaPreference pref)
|
| 77 |
|
| 78 |
case META_PREF_RESIZE_WITH_RIGHT_BUTTON:
|
| 79 |
return "RESIZE_WITH_RIGHT_BUTTON";
|
| 80 |
+
|
| 81 |
+ case META_PREF_FORCE_FULLSCREEN:
|
| 82 |
+ return "FORCE_FULLSCREEN";
|
| 83 |
}
|
| 84 |
|
| 85 |
return "(unknown)";
|
| 86 |
@@ -2737,6 +2741,12 @@ meta_prefs_get_mouse_button_menu (void)
|
| 87 |
return resize_with_right_button ? 2: 3;
|
| 88 |
}
|
| 89 |
|
| 90 |
+gboolean
|
| 91 |
+meta_prefs_get_force_fullscreen (void)
|
| 92 |
+{
|
| 93 |
+ return force_fullscreen;
|
| 94 |
+}
|
| 95 |
+
|
| 96 |
void
|
| 97 |
meta_prefs_set_compositing_manager (gboolean whether)
|
| 98 |
{
|
| 99 |
@@ -2797,3 +2807,10 @@ init_button_layout(void)
|
| 100 |
};
|
| 101 |
|
| 102 |
#endif
|
| 103 |
+
|
| 104 |
+void
|
| 105 |
+meta_prefs_set_force_fullscreen (gboolean whether)
|
| 106 |
+{
|
| 107 |
+ force_fullscreen = whether;
|
| 108 |
+}
|
| 109 |
+
|
| 110 |
diff --git a/src/include/prefs.h b/src/include/prefs.h
|
| 111 |
index 2f1ce8e..a4193ff 100644
|
| 112 |
--- a/src/include/prefs.h
|
| 113 |
+++ b/src/include/prefs.h
|
| 114 |
@@ -59,7 +59,8 @@ typedef enum
|
| 115 |
META_PREF_CURSOR_THEME,
|
| 116 |
META_PREF_CURSOR_SIZE,
|
| 117 |
META_PREF_COMPOSITING_MANAGER,
|
| 118 |
- META_PREF_RESIZE_WITH_RIGHT_BUTTON
|
| 119 |
+ META_PREF_RESIZE_WITH_RIGHT_BUTTON,
|
| 120 |
+ META_PREF_FORCE_FULLSCREEN
|
| 121 |
} MetaPreference;
|
| 122 |
|
| 123 |
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
|
| 124 |
@@ -114,6 +115,7 @@ void meta_prefs_change_workspace_name (int i,
|
| 125 |
const char* meta_prefs_get_cursor_theme (void);
|
| 126 |
int meta_prefs_get_cursor_size (void);
|
| 127 |
gboolean meta_prefs_get_compositing_manager (void);
|
| 128 |
+gboolean meta_prefs_get_force_fullscreen (void);
|
| 129 |
|
| 130 |
/**
|
| 131 |
* Sets whether the compositor is turned on.
|
| 132 |
@@ -122,6 +124,8 @@ gboolean meta_prefs_get_compositing_manager (void);
|
| 133 |
*/
|
| 134 |
void meta_prefs_set_compositing_manager (gboolean whether);
|
| 135 |
|
| 136 |
+void meta_prefs_set_force_fullscreen (gboolean whether);
|
| 137 |
+
|
| 138 |
/* XXX FIXME This should be x-macroed, but isn't yet because it would be
|
| 139 |
* difficult (or perhaps impossible) to add the suffixes using the current
|
| 140 |
* system. It needs some more thought, perhaps after the current system
|
| 141 |
--
|
| 142 |
cgit v0.8.2
|