[metacity] compositor-xrender: include old shape in damage



commit e88707b74f0c504fdd9bf582ea79560a30b6a7f7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Sep 19 03:02:06 2015 +0300

    compositor-xrender: include old shape in damage
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755001

 src/compositor/compositor-xrender.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 2626875..3545408 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -161,6 +161,8 @@ typedef struct _MetaCompWindow
   gboolean damaged;
   gboolean shaped;
 
+  XRectangle shape_bounds;
+
   MetaCompWindowType type;
 
   Damage damage;
@@ -1933,6 +1935,11 @@ add_win (MetaScreen *screen,
   cw->damaged = FALSE;
   cw->shaped = is_shaped (display, xwindow);
 
+  cw->shape_bounds.x = cw->attrs.x;
+  cw->shape_bounds.y = cw->attrs.y;
+  cw->shape_bounds.width = cw->attrs.width;
+  cw->shape_bounds.height = cw->attrs.height;
+
   if (cw->attrs.class == InputOnly)
     cw->damage = None;
   else
@@ -2078,6 +2085,7 @@ resize_win (MetaCompWindow *cw,
   Display *xdisplay = meta_display_get_xdisplay (display);
   MetaCompScreen *info = meta_screen_get_compositor_data (screen);
   XserverRegion damage;
+  XserverRegion shape;
   gboolean debug;
 
   debug = DISPLAY_COMPOSITOR (display)->debug;
@@ -2169,6 +2177,10 @@ resize_win (MetaCompWindow *cw,
       XFixesCopyRegion (xdisplay, damage, cw->extents);
     }
 
+  shape = XFixesCreateRegion (xdisplay, &cw->shape_bounds, 1);
+  XFixesUnionRegion (xdisplay, damage, damage, shape);
+  XFixesDestroyRegion (xdisplay, shape);
+
   dump_xserver_region ("resize_win", display, damage);
   add_damage (screen, damage);
 
@@ -2527,6 +2539,21 @@ process_shape (MetaCompositorXRender *compositor,
 
       if (event->shaped && !cw->shaped)
         cw->shaped = TRUE;
+
+      if (event->shaped == True)
+        {
+          cw->shape_bounds.x = cw->attrs.x + event->x;
+          cw->shape_bounds.y = cw->attrs.y + event->y;
+          cw->shape_bounds.width = event->width;
+          cw->shape_bounds.height = event->height;
+        }
+      else
+        {
+          cw->shape_bounds.x = cw->attrs.x;
+          cw->shape_bounds.y = cw->attrs.y;
+          cw->shape_bounds.width = cw->attrs.width;
+          cw->shape_bounds.height = cw->attrs.height;
+        }
     }
 }
 


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