[mutter] MetaBackendX11: Don't XResizeWindow behind clutter's back



commit 602dd7fdf2e09c2a0e08925780a7b6c5434ee312
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Sep 8 14:14:33 2014 -0400

    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 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 84c5b07..98afbbe 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]