summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2014-03-05 19:01:11 -0500
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-10-10 17:29:45 +0300
commit41dd72bc5dd08d7d0cb136f694a6d9a30e38b341 (patch)
tree48559159eea0cac2f3cb5f92f92f1605d5eb4984
parentcae916f377a04938a3f9396fa72a4294b1db59a1 (diff)
downloadmetacity-41dd72bc5dd08d7d0cb136f694a6d9a30e38b341.tar.gz
Fix identification of CSD windows when checking whether to force fullscreen
We try to exempt CSD windows from being forced fullscreen if they are undecorated and the size of the screen; however, we also catch almost all windows that *do* need to be forced fullscreen in this check, since they also have decorations turned off. Identify actual CSD windows by checking whether _GTK_FRAME_EXTENTS is set - GTK+ will always set this on CSD windows even if they have no invisible borders or shadows at the current time. https://bugzilla.gnome.org/show_bug.cgi?id=723029
-rw-r--r--src/core/constraints.c2
-rw-r--r--src/core/window-private.h1
-rw-r--r--src/core/window.c18
3 files changed, 20 insertions, 1 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 0dc93cb0..a937f053 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -438,7 +438,7 @@ setup_constraint_info (ConstraintInfo *info,
* workarea smaller than the monitor.
*/
if (meta_prefs_get_force_fullscreen() &&
- window->decorated &&
+ (window->decorated || !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (new, &xinerama_info->rect) &&
window->has_fullscreen_func &&
!window->fullscreen)
diff --git a/src/core/window-private.h b/src/core/window-private.h
index a98cee36..2eb8ae62 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -660,5 +660,6 @@ void meta_window_unset_demands_attention (MetaWindow *window);
void meta_window_update_icon_now (MetaWindow *window);
gboolean meta_window_can_tile_side_by_side (MetaWindow *window);
+gboolean meta_window_is_client_decorated (MetaWindow *window);
#endif
diff --git a/src/core/window.c b/src/core/window.c
index 74994bd9..8e4345d2 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8474,3 +8474,21 @@ meta_window_is_maximized (MetaWindow *window)
{
return META_WINDOW_MAXIMIZED (window);
}
+
+/**
+ * meta_window_is_client_decorated:
+ *
+ * Check if if the window has decorations drawn by the client.
+ * (window->decorated refers only to whether we should add decorations)
+ */
+gboolean
+meta_window_is_client_decorated (MetaWindow *window)
+{
+ /* Currently the implementation here is hackish -
+ * has_custom_frame_extents() is set if _GTK_FRAME_EXTENTS is set
+ * to any value even 0. GTK+ always sets _GTK_FRAME_EXTENTS for
+ * client-side-decorated window, even if the value is 0 because
+ * the window is maxized and has no invisible borders or shadows.
+ */
+ return window->has_custom_frame_extents;
+}