[metacity] compositor: fix border_size



commit 72003d38721ae59d90f12cafb3ebee08ed96ee68
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jan 20 05:02:26 2015 +0200

    compositor: fix border_size

 src/compositor/compositor-xrender.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 0387520..a86e4e8 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -1112,8 +1112,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);
@@ -1123,6 +1133,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;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]