summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2014-03-05 19:01:11 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2014-03-11 13:02:19 -0400
commit2cf80bc6474ad2c7f6b1ec212575c810b8b073e4 (patch)
tree280042d0bd06def00233d62a62033d4cac826d5e
parent40c15f6e2a5fcd66f8b0a96737eaf669da64bb84 (diff)
downloadmutter-2cf80bc6474ad2c7f6b1ec212575c810b8b073e4.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. We explicitly turn off the legacy-fullscreen check for native wayland windows so we don't start legacy-fullscreening them if the new meta_window_is_client_decorated() is later made more accurate. https://bugzilla.gnome.org/show_bug.cgi?id=723029
-rw-r--r--src/core/constraints.c3
-rw-r--r--src/core/window-private.h2
-rw-r--r--src/core/window.c28
3 files changed, 32 insertions, 1 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index b59aa065f..8bb9b2510 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -425,8 +425,9 @@ setup_constraint_info (ConstraintInfo *info,
* the monitor.
*/
if (meta_prefs_get_force_fullscreen() &&
+ window->client_type != META_WINDOW_CLIENT_TYPE_WAYLAND &&
!window->hide_titlebar_when_maximized &&
- window->decorated &&
+ (window->decorated || !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (new, &monitor_info->rect) &&
window->has_fullscreen_func &&
!window->fullscreen)
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 2d2f8ae2d..30805776d 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -751,4 +751,6 @@ void meta_window_activate_full (MetaWindow *window,
MetaClientType source_indication,
MetaWorkspace *workspace);
+gboolean meta_window_is_client_decorated (MetaWindow *window);
+
#endif
diff --git a/src/core/window.c b/src/core/window.c
index dcc272548..01cdc6f79 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8856,6 +8856,34 @@ meta_window_same_application (MetaWindow *window,
group==other_group;
}
+/**
+ * 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)
+{
+ if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
+ {
+ /* Assume all Wayland clients draw decorations - not strictly
+ * true but good enough for current purposes.
+ */
+ return TRUE;
+ }
+ else
+ {
+ /* 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;
+ }
+}
+
void
meta_window_refresh_resize_popup (MetaWindow *window)
{