[mutter/wip/carlosg/frames-client: 36/39] compositor: Opt out compositor shadows from windows with frames




commit cf8a226dde9b1b4bdf5da2e68cbda603abee41d3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 12 12:27:03 2022 +0200

    compositor: Opt out compositor shadows from windows with frames
    
    Let the frames client render its own shadow. In order to do that,
    avoid double painting a shadow on the compositor side, and extend
    the mask area of the frame, so it does unveil the (so far)
    hidden frames-client-side shadows.

 src/compositor/meta-window-actor-x11.c | 4 ++--
 src/core/frame.c                       | 7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index f6e18dea72..9d68ac9e6e 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -399,11 +399,11 @@ has_shadow (MetaWindowActorX11 *actor_x11)
     return FALSE;
 
   /*
-   * Always put a shadow around windows with a frame - This should override
+   * Let the frames client put a shadow around frames - This should override
    * the restriction about not putting a shadow around ARGB windows.
    */
   if (meta_window_get_frame (window))
-    return TRUE;
+    return FALSE;
 
   /*
    * Do not add shadows to non-opaque (ARGB32) windows, as we can't easily
diff --git a/src/core/frame.c b/src/core/frame.c
index 1be05a8ce4..9b195d81ea 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -470,10 +470,9 @@ meta_frame_get_mask (MetaFrame             *frame,
   meta_frame_calc_borders (frame, &borders);
 
   cairo_rectangle (cr,
-                   borders.invisible.left,
-                   borders.invisible.top,
-                   frame_rect->width,
-                   frame_rect->height);
+                   0, 0,
+                   frame->rect.width,
+                   frame->rect.height);
   cairo_set_source_rgb (cr, 0, 0, 0);
   cairo_fill (cr);
 }


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