[mutter/wip/carlosg/clip-me-harder: 546/548] compositor: Cull out areas covered by opaque windows



commit e854bf6e621c72c28e70b8c6cf4234ca8b5eb599
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 27 15:45:10 2019 +0100

    compositor: Cull out areas covered by opaque windows
    
    Wayland clients do this through the opaque region in the surface
    actor. However X11 clients were considered fully transparent for
    culling purposes, which may result in mutter painting other bits
    of the background or other windows that will be painted over in
    reality.

 src/compositor/meta-window-actor.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 79fdbef1e..9b5bad188 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1341,9 +1341,18 @@ meta_window_actor_cull_out (MetaCullable   *cullable,
                             cairo_region_t *clip_region)
 {
   MetaWindowActor *self = META_WINDOW_ACTOR (cullable);
+  MetaWindowActorPrivate *priv =
+    meta_window_actor_get_instance_private (self);
 
   meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
   meta_window_actor_set_clip_region_beneath (self, clip_region);
+
+  if (unobscured_region && !is_non_opaque (self) && priv->window->frame)
+    {
+      cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
+      if (frame_bounds)
+        cairo_region_subtract (unobscured_region, frame_bounds);
+    }
 }
 
 static void


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