diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-09-19 03:02:06 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-09-23 15:29:20 +0300 |
commit | e88707b74f0c504fdd9bf582ea79560a30b6a7f7 (patch) | |
tree | 63a103a1cdd0fa86bb0ecc451e5ea6de500b9a4f /src/compositor | |
parent | 9a11f30a7e712c7002aa4fd4cf219166fb4cde9e (diff) | |
download | metacity-e88707b74f0c504fdd9bf582ea79560a30b6a7f7.tar.gz |
compositor-xrender: include old shape in damage
https://bugzilla.gnome.org/show_bug.cgi?id=755001
Diffstat (limited to 'src/compositor')
-rw-r--r-- | 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 26268754..35454082 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; + } } } |