summaryrefslogtreecommitdiff
path: root/src/compositor/compositor-xrender.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 13:09:37 -0400
committerVictor Kareh <[email protected]>2019-06-05 10:49:37 -0400
commit0f37fceb6b2dd39b2693cd3f02a192e3afff96b2 (patch)
tree5203f8c373ac58f8a406217e28c84afc24727e48 /src/compositor/compositor-xrender.c
parent74a74246ea975400f4b876240d3040bba6e82a7a (diff)
downloadmarco-0f37fceb6b2dd39b2693cd3f02a192e3afff96b2.tar.bz2
marco-0f37fceb6b2dd39b2693cd3f02a192e3afff96b2.tar.xz
compositor: fix border_size
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72003d38
Diffstat (limited to 'src/compositor/compositor-xrender.c')
-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;
}