From 0f37fceb6b2dd39b2693cd3f02a192e3afff96b2 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 23 May 2019 13:09:37 -0400 Subject: compositor: fix border_size upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72003d38 --- src/compositor/compositor-xrender.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/compositor') 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; } -- cgit v1.2.1