[mutter] window-actor/x11: Update shape even when frozen



commit c0038f6dac088c2b15f5e10de89a495b5abe71e0
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Fri Dec 6 15:13:03 2019 +0100

    window-actor/x11: Update shape even when frozen
    
    On Xwayland, freezing actor updates on sync requests means the
    server-side frame and shadows repaint will be frozen as well, which
    causes the shadow to show black at times when resizing X11 clients
    which support NET_WM_SYNC.
    
    Using freeze/thaw commits prevents the content from changing, yet the
    shape window still needs to be updated when frozen otherwise the
    difference in shape induced by the on-going resize operation will show
    as well, even if the toplevel window has its commits frozen.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/942
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=767212
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/858

 src/compositor/meta-window-actor-x11.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index f5b18414e..11816bbeb 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -1111,17 +1111,28 @@ handle_updates (MetaWindowActorX11 *actor_x11)
   MetaSurfaceActor *surface =
     meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
 
+  if (META_IS_SURFACE_ACTOR_X11 (surface) &&
+      meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
+    return;
+
   if (meta_window_actor_is_frozen (META_WINDOW_ACTOR (actor_x11)))
     {
+      MetaWindow *window =
+        meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
+
       /* The window is frozen due to a pending animation: we'll wait until
-       * the animation finishes to reshape and repair the window */
+       * the animation finishes to repair the window.
+       *
+       * However, with Xwayland, we still might need to update the shape
+       * region as the wl_buffer will be set to plain black on resize,
+       * which causes the shadows to look bad.
+       */
+      if (surface && meta_window_x11_always_update_shape (window))
+        update_shape_region (actor_x11);
+
       return;
     }
 
-  if (META_IS_SURFACE_ACTOR_X11 (surface) &&
-      meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
-    return;
-
   meta_surface_actor_pre_paint (surface);
 
   if (!meta_surface_actor_is_visible (surface))


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