summaryrefslogtreecommitdiffstats
path: root/metacity-option-to-force-fullscreen.patch
blob: f09adafc1338bd74f81ce1dac1bf0708a0a92fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
From b625ec30d99b2dcf86d8fa78b09f6d04dce3a6e0 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu@sugarlabs.org>
Date: Fri, 19 Jun 2009 15:30:37 +0000
Subject: Add a switch to disable autofullscreen'ing maximized windows without decorations

---
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 800b293..a060d20 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -27,6 +27,7 @@
 #include "constraints.h"
 #include "workspace.h"
 #include "place.h"
+#include "prefs.h"
 
 #include <stdlib.h>
 #include <math.h>
@@ -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, &xinerama_info->rect) &&
+  if (meta_prefs_get_force_fullscreen() &&
+      meta_rectangle_equal (new, &xinerama_info->rect) &&
       window->has_fullscreen_func &&
       !window->fullscreen)
     {
diff --git a/src/core/main.c b/src/core/main.c
index 6c36f10..a36a396 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -233,6 +233,7 @@ typedef struct
   gboolean sync;
   gboolean composite;
   gboolean no_composite;
+  gboolean no_force_fullscreen;
 } MetaArguments;
 
 #ifdef HAVE_COMPOSITE_EXTENSIONS
@@ -314,6 +315,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
+    },
     {NULL}
   };
   GOptionContext *ctx;
@@ -584,6 +591,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_display_open ())
     meta_exit (META_EXIT_ERROR);
   
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 1f4fe41..6e41b3c 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -95,6 +95,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;
@@ -1751,6 +1752,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";
     }
 
   return "(unknown)";
@@ -2737,6 +2741,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)
 {
@@ -2797,3 +2807,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 2f1ce8e..a4193ff 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -59,7 +59,8 @@ typedef enum
   META_PREF_CURSOR_THEME,
   META_PREF_CURSOR_SIZE,
   META_PREF_COMPOSITING_MANAGER,
-  META_PREF_RESIZE_WITH_RIGHT_BUTTON
+  META_PREF_RESIZE_WITH_RIGHT_BUTTON,
+  META_PREF_FORCE_FULLSCREEN
 } MetaPreference;
 
 typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -114,6 +115,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.
@@ -122,6 +124,8 @@ gboolean    meta_prefs_get_compositing_manager (void);
  */
 void meta_prefs_set_compositing_manager (gboolean whether);
 
+void meta_prefs_set_force_fullscreen (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
--
cgit v0.8.2