[metacity/wip/gtk-theme: 41/41] compositor: fix shadow size
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/wip/gtk-theme: 41/41] compositor: fix shadow size
- Date: Wed, 7 Jan 2015 12:39:35 +0000 (UTC)
commit cda936d9520118811611def2a9e02c69c8327187
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jan 7 14:32:41 2015 +0200
compositor: fix shadow size
src/compositor/compositor-xrender.c | 20 ++++++++++++++++----
src/core/frame-private.h | 4 ----
src/include/frame.h | 4 ++++
3 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 99e10b2..30aea43 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -971,21 +971,33 @@ win_extents (MetaCompWindow *cw)
if (cw->needs_shadow)
{
+ MetaFrameBorders borders;
XRectangle sr;
- cw->shadow_dx = shadow_offsets_x [cw->shadow_type];
- cw->shadow_dy = shadow_offsets_y [cw->shadow_type];
+ meta_frame_borders_clear (&borders);
+ if (cw->window)
+ {
+ MetaFrame *frame = meta_window_get_frame (cw->window);
+
+ if (frame)
+ meta_frame_calc_borders (frame, &borders);
+ }
+
+ cw->shadow_dx = shadow_offsets_x [cw->shadow_type] + borders.invisible.left;
+ cw->shadow_dy = 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,
- 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);
}
diff --git a/src/core/frame-private.h b/src/core/frame-private.h
index 5a35334..d0a2176 100644
--- a/src/core/frame-private.h
+++ b/src/core/frame-private.h
@@ -57,10 +57,6 @@ void meta_frame_queue_draw (MetaFrame *frame);
MetaFrameFlags meta_frame_get_flags (MetaFrame *frame);
-/* These should ONLY be called from meta_window_move_resize_internal */
-void meta_frame_calc_borders (MetaFrame *frame,
- MetaFrameBorders *borders);
-
void meta_frame_get_corner_radiuses (MetaFrame *frame,
float *top_left,
float *top_right,
diff --git a/src/include/frame.h b/src/include/frame.h
index 09b7457..5a0ae25 100644
--- a/src/include/frame.h
+++ b/src/include/frame.h
@@ -22,8 +22,12 @@
#include <X11/Xlib.h>
+#include "common.h"
#include "types.h"
Window meta_frame_get_xwindow (MetaFrame *frame);
+void meta_frame_calc_borders (MetaFrame *frame,
+ MetaFrameBorders *borders);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]