summaryrefslogtreecommitdiff
path: root/src/compositor
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 11:43:04 -0400
committerVictor Kareh <[email protected]>2019-06-05 10:49:37 -0400
commitbb3c8630f4efe78f28f6ad0d7a185b1cf88395b4 (patch)
tree76eee5cdf4db88aff1efd40fa5ea5bcb5c3acbc6 /src/compositor
parent38ea989eee6ed3606b12a396cabfb2c6a177daea (diff)
downloadmarco-bb3c8630f4efe78f28f6ad0d7a185b1cf88395b4.tar.bz2
marco-bb3c8630f4efe78f28f6ad0d7a185b1cf88395b4.tar.xz
compositor: fix shadow size and placement
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/9fd053da
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor-xrender.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 0d8b3b6c..0748e13e 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -648,8 +648,8 @@ shadow_picture_clip (Display *xdisplay,
if (!visible_region)
return;
- shadow_dx = -1 * shadow_offsets_x [cw->shadow_type];
- shadow_dy = -1 * shadow_offsets_y [cw->shadow_type];
+ shadow_dx = -1 * (int) shadow_offsets_x [cw->shadow_type] - borders.invisible.left;
+ shadow_dy = -1 * (int) shadow_offsets_y [cw->shadow_type] - borders.invisible.top;
rect.x = 0;
rect.y = 0;
@@ -1094,18 +1094,21 @@ 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, opacity, 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);
}