[metacity] compositor: fix shadow size and placement
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: fix shadow size and placement
- Date: Tue, 20 Jan 2015 21:37:25 +0000 (UTC)
commit 9fd053da321c2c1374d7209c470f1c7b6e0de59f
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 | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 0f92e19..0387520 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -651,8 +651,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;
@@ -1061,18 +1061,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]