[metacity/wip/invisible-borders: 7/25] compositor: fix shadow size and placement



commit 2716bdb5dfb3f7f147b47618479bf425f941d979
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Jan 19 15:17:10 2015 +0200

    compositor: fix shadow size and placement

 src/compositor/compositor-xrender.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index dd99329..38ac0d9 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -1031,20 +1031,23 @@ win_extents (MetaCompWindow *cw)
             meta_frame_calc_borders (frame, &borders);
         }
 
-      cw->shadow_dx = shadow_offsets_x [cw->shadow_type];
-      cw->shadow_dy = shadow_offsets_y [cw->shadow_type];
+      cw->shadow_dx = (int) shadow_offsets_x [cw->shadow_type] + borders.invisible.left;
+      cw->shadow_dy = (int) shadow_offsets_y [cw->shadow_type] + borders.invisible.top;
 
       if (!cw->shadow)
         {
           double opacity = SHADOW_OPACITY;
+          int invisible_width = borders.invisible.left + borders.invisible.right;
+          int invisible_height = borders.invisible.top + borders.invisible.bottom;
+
           if (cw->opacity != (guint) OPAQUE)
             opacity = opacity * ((double) cw->opacity) / ((double) OPAQUE);
 
           cw->shadow = shadow_picture (display, screen, cw->shadow_type,
                                        opacity, cw->alpha_pict,
                                        borders,
-                                       cw->attrs.width + cw->attrs.border_width * 2,
-                                       cw->attrs.height + cw->attrs.border_width * 2,
+                                       cw->attrs.width - invisible_width + cw->attrs.border_width * 2,
+                                       cw->attrs.height - invisible_height + cw->attrs.border_width * 2,
                                        &cw->shadow_width, &cw->shadow_height);
         }
 


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