diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-04-15 23:01:56 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-04-15 23:50:53 +0300 |
commit | e1231d85e656fc8a566002f0b9e848c83e348d8d (patch) | |
tree | 04280d7396cd0f916d2210f4382ab136d2ba3985 /src | |
parent | 598195635f1e0a8796a2c4d0449991d47c509f62 (diff) | |
download | metacity-e1231d85e656fc8a566002f0b9e848c83e348d8d.tar.gz |
compositor: rename window_size to visible_region
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor-xrender.c | 92 |
1 files changed, 52 insertions, 40 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index f086f33b..0ade045d 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -175,9 +175,9 @@ typedef struct _MetaCompWindow Picture shadow_pict; XserverRegion window_region; + XserverRegion visible_region; XserverRegion client_region; - XserverRegion window_size; XserverRegion extents; Picture shadow; @@ -1193,38 +1193,50 @@ get_client_region (MetaCompWindow *cw) } static XserverRegion -window_size (MetaCompWindow *cw) +get_visible_region (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; + MetaDisplay *display; + Display *xdisplay; + XserverRegion region; - if (cw->window) - { - visible_region = meta_window_get_frame_bounds (cw->window); + display = meta_screen_get_display (cw->screen); + xdisplay = meta_display_get_xdisplay (display); - if (visible_region) - visible = cairo_region_to_xserver_region (xdisplay, visible_region); + if (cw->window_region != None) + { + region = XFixesCreateRegion (xdisplay, NULL, 0); + XFixesCopyRegion (xdisplay, region, cw->window_region); + } + else + { + region = get_window_region (cw); + if (region == None) + return None; } - border = get_window_region (cw); - - if (visible != None) + if (cw->window) { - XFixesTranslateRegion (xdisplay, visible, - cw->attrs.x + cw->attrs.border_width, - cw->attrs.y + cw->attrs.border_width); + cairo_region_t *visible; + XserverRegion tmp; + + visible = meta_window_get_frame_bounds (cw->window); + tmp = visible ? cairo_region_to_xserver_region (xdisplay, visible) : None; - XFixesIntersectRegion (xdisplay, visible, visible, border); - XFixesDestroyRegion (xdisplay, border); + if (tmp != None) + { + int x; + int y; + + x = cw->attrs.x + cw->attrs.border_width; + y = cw->attrs.y + cw->attrs.border_width; - return visible; + XFixesTranslateRegion (xdisplay, tmp, x, y); + XFixesIntersectRegion (xdisplay, region, region, tmp); + XFixesDestroyRegion (xdisplay, tmp); + } } - return border; + return region; } static XRenderPictFormat * @@ -1402,16 +1414,16 @@ paint_windows (MetaScreen *screen, cw->window_region = None; } - if (cw->client_region) + if (cw->visible_region) { - XFixesDestroyRegion (xdisplay, cw->client_region); - cw->client_region = None; + XFixesDestroyRegion (xdisplay, cw->visible_region); + cw->visible_region = None; } - if (cw->window_size) + if (cw->client_region) { - XFixesDestroyRegion (xdisplay, cw->window_size); - cw->window_size = None; + XFixesDestroyRegion (xdisplay, cw->client_region); + cw->client_region = None; } #if 0 @@ -1426,12 +1438,12 @@ paint_windows (MetaScreen *screen, if (cw->window_region == None) cw->window_region = get_window_region (cw); + if (cw->visible_region == None) + cw->visible_region = get_visible_region (cw); + if (cw->client_region == None) cw->client_region = get_client_region (cw); - if (cw->window_size == None) - cw->window_size = window_size (cw); - if (cw->extents == None) cw->extents = win_extents (cw); @@ -1490,7 +1502,7 @@ paint_windows (MetaScreen *screen, shadow_clip = XFixesCreateRegion (xdisplay, NULL, 0); XFixesSubtractRegion (xdisplay, shadow_clip, cw->border_clip, - cw->window_size); + cw->visible_region); XFixesSetPictureClipRegion (xdisplay, root_buffer, 0, 0, shadow_clip); @@ -1777,16 +1789,16 @@ free_win (MetaCompWindow *cw, cw->window_region = None; } - if (cw->client_region) + if (cw->visible_region) { - XFixesDestroyRegion (xdisplay, cw->client_region); - cw->client_region = None; + XFixesDestroyRegion (xdisplay, cw->visible_region); + cw->visible_region = None; } - if (cw->window_size) + if (cw->client_region) { - XFixesDestroyRegion (xdisplay, cw->window_size); - cw->window_size = None; + XFixesDestroyRegion (xdisplay, cw->client_region); + cw->client_region = None; } if (cw->border_clip) @@ -2058,9 +2070,9 @@ add_win (MetaScreen *screen, cw->shadow_pict = None; cw->window_region = None; + cw->visible_region = None; cw->client_region = None; - cw->window_size = None; cw->extents = None; cw->shadow = None; cw->shadow_dx = 0; |