From 118c8dc33376ba80dc7652392e5b30da9c102d77 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu@sugarlabs.org>
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 800b293..a060d20 100644
a
|
b
|
|
27 | 27 | #include "constraints.h" |
28 | 28 | #include "workspace.h" |
29 | 29 | #include "place.h" |
| 30 | #include "prefs.h" |
30 | 31 | |
31 | 32 | #include <stdlib.h> |
32 | 33 | #include <math.h> |
… |
… |
setup_constraint_info (ConstraintInfo *info, |
424 | 425 | /* Workaround braindead legacy apps that don't know how to |
425 | 426 | * fullscreen themselves properly. |
426 | 427 | */ |
427 | | if (meta_rectangle_equal (new, &xinerama_info->rect) && |
| 428 | if (meta_prefs_get_force_fullscreen() && |
| 429 | meta_rectangle_equal (new, &xinerama_info->rect) && |
428 | 430 | window->has_fullscreen_func && |
429 | 431 | !window->fullscreen) |
430 | 432 | { |
diff --git a/src/core/main.c b/src/core/main.c
index 6c36f10..a36a396 100644
a
|
b
|
typedef struct |
233 | 233 | gboolean sync; |
234 | 234 | gboolean composite; |
235 | 235 | gboolean no_composite; |
| 236 | gboolean no_force_fullscreen; |
236 | 237 | } MetaArguments; |
237 | 238 | |
238 | 239 | #ifdef HAVE_COMPOSITE_EXTENSIONS |
… |
… |
meta_parse_options (int *argc, char ***argv, |
314 | 315 | N_("Turn compositing off"), |
315 | 316 | NULL |
316 | 317 | }, |
| 318 | { |
| 319 | "no-force-fullscreen", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, |
| 320 | &my_args.no_force_fullscreen, |
| 321 | N_("Don't make fullscreen windows that are maximized and have no decorations"), |
| 322 | NULL |
| 323 | }, |
317 | 324 | {NULL} |
318 | 325 | }; |
319 | 326 | GOptionContext *ctx; |
… |
… |
main (int argc, char **argv) |
584 | 591 | if (meta_args.composite || meta_args.no_composite) |
585 | 592 | meta_prefs_set_compositing_manager (meta_args.composite); |
586 | 593 | |
| 594 | if (meta_args.no_force_fullscreen) |
| 595 | meta_prefs_set_force_fullscreen (FALSE); |
| 596 | |
587 | 597 | if (!meta_display_open ()) |
588 | 598 | meta_exit (META_EXIT_ERROR); |
589 | 599 | |
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 1f4fe41..6e41b3c 100644
a
|
b
|
static char *cursor_theme = NULL; |
95 | 95 | static int cursor_size = 24; |
96 | 96 | static gboolean compositing_manager = FALSE; |
97 | 97 | static gboolean resize_with_right_button = FALSE; |
| 98 | static gboolean force_fullscreen = TRUE; |
98 | 99 | |
99 | 100 | static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH; |
100 | 101 | static MetaButtonLayout button_layout; |
… |
… |
meta_preference_to_string (MetaPreference pref) |
1751 | 1752 | |
1752 | 1753 | case META_PREF_RESIZE_WITH_RIGHT_BUTTON: |
1753 | 1754 | return "RESIZE_WITH_RIGHT_BUTTON"; |
| 1755 | |
| 1756 | case META_PREF_FORCE_FULLSCREEN: |
| 1757 | return "FORCE_FULLSCREEN"; |
1754 | 1758 | } |
1755 | 1759 | |
1756 | 1760 | return "(unknown)"; |
… |
… |
meta_prefs_get_mouse_button_menu (void) |
2737 | 2741 | return resize_with_right_button ? 2: 3; |
2738 | 2742 | } |
2739 | 2743 | |
| 2744 | gboolean |
| 2745 | meta_prefs_get_force_fullscreen (void) |
| 2746 | { |
| 2747 | return force_fullscreen; |
| 2748 | } |
| 2749 | |
2740 | 2750 | void |
2741 | 2751 | meta_prefs_set_compositing_manager (gboolean whether) |
2742 | 2752 | { |
… |
… |
init_button_layout(void) |
2797 | 2807 | }; |
2798 | 2808 | |
2799 | 2809 | #endif |
| 2810 | |
| 2811 | void |
| 2812 | meta_prefs_set_force_fullscreen (gboolean whether) |
| 2813 | { |
| 2814 | force_fullscreen = whether; |
| 2815 | } |
| 2816 | |
diff --git a/src/include/prefs.h b/src/include/prefs.h
index 2f1ce8e..a4193ff 100644
a
|
b
|
typedef enum |
59 | 59 | META_PREF_CURSOR_THEME, |
60 | 60 | META_PREF_CURSOR_SIZE, |
61 | 61 | META_PREF_COMPOSITING_MANAGER, |
62 | | META_PREF_RESIZE_WITH_RIGHT_BUTTON |
| 62 | META_PREF_RESIZE_WITH_RIGHT_BUTTON, |
| 63 | META_PREF_FORCE_FULLSCREEN |
63 | 64 | } MetaPreference; |
64 | 65 | |
65 | 66 | typedef void (* MetaPrefsChangedFunc) (MetaPreference pref, |
… |
… |
void meta_prefs_change_workspace_name (int i, |
114 | 115 | const char* meta_prefs_get_cursor_theme (void); |
115 | 116 | int meta_prefs_get_cursor_size (void); |
116 | 117 | gboolean meta_prefs_get_compositing_manager (void); |
| 118 | gboolean meta_prefs_get_force_fullscreen (void); |
117 | 119 | |
118 | 120 | /** |
119 | 121 | * Sets whether the compositor is turned on. |
… |
… |
gboolean meta_prefs_get_compositing_manager (void); |
122 | 124 | */ |
123 | 125 | void meta_prefs_set_compositing_manager (gboolean whether); |
124 | 126 | |
| 127 | void meta_prefs_set_force_fullscreen (gboolean whether); |
| 128 | |
125 | 129 | /* XXX FIXME This should be x-macroed, but isn't yet because it would be |
126 | 130 | * difficult (or perhaps impossible) to add the suffixes using the current |
127 | 131 | * system. It needs some more thought, perhaps after the current system |