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



commit 49cea6895b6ffbbfa37a320aa5770b9e4224ba47
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 cf7c4642d..7bf0febb0 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1370,9 +1370,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]