summaryrefslogtreecommitdiff
path: root/src/compositor
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 13:09:37 -0400
committerraveit65 <[email protected]>2019-06-16 18:12:44 +0200
commit95f81090e12dbd5e01ce8ceaf585368667e0e1c3 (patch)
tree319edfc4f56266b674256e5075379ce8ab954632 /src/compositor
parentfa32fffe0f6b0191cd17ce9ab19f89c4082497cf (diff)
downloadmarco-95f81090e12dbd5e01ce8ceaf585368667e0e1c3.tar.bz2
marco-95f81090e12dbd5e01ce8ceaf585368667e0e1c3.tar.xz
compositor: fix border_size
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72003d38
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor-xrender.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 0748e13e..dc7ac15f 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -1145,8 +1145,18 @@ border_size (MetaCompWindow *cw)
MetaScreen *screen = cw->screen;
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display);
+ cairo_region_t *visible_region;
+ XserverRegion visible = None;
XserverRegion border;
+ if (cw->window)
+ {
+ visible_region = meta_window_get_frame_bounds (cw->window);
+
+ if (visible_region)
+ visible = cairo_region_to_xserver_region (xdisplay, visible_region);
+ }
+
meta_error_trap_push (display);
border = XFixesCreateRegionFromWindow (xdisplay, cw->id,
WindowRegionBounding);
@@ -1156,6 +1166,19 @@ border_size (MetaCompWindow *cw)
XFixesTranslateRegion (xdisplay, border,
cw->attrs.x + cw->attrs.border_width,
cw->attrs.y + cw->attrs.border_width);
+
+ if (visible != None)
+ {
+ XFixesTranslateRegion (xdisplay, visible,
+ cw->attrs.x + cw->attrs.border_width,
+ cw->attrs.y + cw->attrs.border_width);
+
+ XFixesIntersectRegion (xdisplay, visible, visible, border);
+ XFixesDestroyRegion (xdisplay, border);
+
+ return visible;
+ }
+
return border;
}