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



commit 508b53747b93dcfb3139b42e270376c2affa0574
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 70fabfb7d..0f95631de 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]