summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-12-16 13:44:48 +0100
committerCarlos Garnacho <carlosg@gnome.org>2023-03-03 20:33:18 +0000
commitbeeeea546b2145e138a247334d81cfa984da3308 (patch)
tree171778eefafa9f11418a61b6bda87bdcc576f9dc
parent1a210218c99bb0c992f8444b0654c834a8892915 (diff)
downloadmutter-beeeea546b2145e138a247334d81cfa984da3308.tar.gz
core: Avoid setting up frames on fullscreen windows
Ensure we preserve the fast zero-copy paths in Xwayland fullscreen windows, instead of maybe rendering the client surface on top of the frame surface, and providing the latter to the compositor. To achieve this, additionally synchronize frame state when recalculating features (e.g. after fullscreen/unfullscreen), and account for this new condition when creating or destroying frames. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2797>
-rw-r--r--src/core/frame.c3
-rw-r--r--src/core/window.c19
-rw-r--r--src/x11/window-x11.c2
3 files changed, 17 insertions, 7 deletions
diff --git a/src/core/frame.c b/src/core/frame.c
index 9b08d0727..c2f0b43b1 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -45,6 +45,9 @@ meta_window_ensure_frame (MetaWindow *window)
MetaX11Display *x11_display = window->display->x11_display;
unsigned long data[1] = { 1 };
+ if (window->frame)
+ return;
+
meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay,
diff --git a/src/core/window.c b/src/core/window.c
index c94e70e47..03dd0506a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -851,7 +851,7 @@ client_window_should_be_mapped (MetaWindow *window)
#endif
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
- window->decorated && !window->frame)
+ window->decorated && !window->fullscreen && !window->frame)
return FALSE;
return TRUE;
@@ -1705,7 +1705,7 @@ meta_window_should_be_showing (MetaWindow *window)
#endif
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
- window->decorated && !window->frame)
+ window->decorated && !window->fullscreen && !window->frame)
return FALSE;
/* Windows should be showing if they're located on the
@@ -5325,6 +5325,15 @@ meta_window_update_struts (MetaWindow *window)
}
static void
+sync_needs_frame (MetaWindow *window)
+{
+ if (window->decorated && !window->fullscreen)
+ meta_window_ensure_frame (window);
+ else
+ meta_window_destroy_frame (window);
+}
+
+static void
meta_window_type_changed (MetaWindow *window)
{
gboolean old_decorated = window->decorated;
@@ -5337,10 +5346,7 @@ meta_window_type_changed (MetaWindow *window)
set_net_wm_state (window);
/* Update frame */
- if (window->decorated)
- meta_window_ensure_frame (window);
- else
- meta_window_destroy_frame (window);
+ sync_needs_frame (window);
/* update stacking constraints */
meta_window_update_layer (window);
@@ -5611,6 +5617,7 @@ meta_window_recalc_features (MetaWindow *window)
if (window->has_resize_func != old_has_resize_func)
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_RESIZEABLE]);
+ sync_needs_frame (window);
meta_window_frame_size_changed (window);
}
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 3b3ea502f..0e7b7fd2f 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -562,7 +562,7 @@ meta_window_x11_manage (MetaWindow *window)
if (!window->override_redirect)
update_sm_hints (window); /* must come after transient_for */
- if (window->decorated)
+ if (window->decorated && !window->fullscreen)
meta_window_ensure_frame (window);
else
meta_window_x11_initialize_state (window);