From 602dd7fdf2e09c2a0e08925780a7b6c5434ee312 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 8 Sep 2014 14:14:33 -0400 Subject: [PATCH] MetaBackendX11: Don't XResizeWindow behind clutter's back In the case of a nested Wayland compositor inside an X session, Clutter is managing the toplevel window size, so don't call XResizeWindow on it - this will confuse Clutter and get the size and the hints out of sync on the toplevel window. https://bugzilla.gnome.org/show_bug.cgi?id=736279 --- src/backends/x11/meta-backend-x11.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 84c5b07e1..98afbbe72 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -631,10 +631,20 @@ static void meta_backend_x11_update_screen_size (MetaBackend *backend, int width, int height) { - MetaBackendX11 *x11 = META_BACKEND_X11 (backend); - MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11); - Window xwin = meta_backend_x11_get_xwindow (x11); - XResizeWindow (priv->xdisplay, xwin, width, height); + if (meta_is_wayland_compositor ()) + { + /* For a nested wayland session, we want to go through Clutter to update the + * toplevel window size, rather than doing it directly. + */ + META_BACKEND_CLASS (meta_backend_x11_parent_class)->update_screen_size (backend, width, height); + } + else + { + MetaBackendX11 *x11 = META_BACKEND_X11 (backend); + MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11); + Window xwin = meta_backend_x11_get_xwindow (x11); + XResizeWindow (priv->xdisplay, xwin, width, height); + } } static void