diff options
Diffstat (limited to 'gdk/macos/GdkMacosCairoView.c')
-rw-r--r-- | gdk/macos/GdkMacosCairoView.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdk/macos/GdkMacosCairoView.c b/gdk/macos/GdkMacosCairoView.c index 2f82488912..81ac8af6a3 100644 --- a/gdk/macos/GdkMacosCairoView.c +++ b/gdk/macos/GdkMacosCairoView.c @@ -78,6 +78,7 @@ -(void)setOpaqueRegion:(cairo_region_t *)region { + cairo_region_t *transparent_clip; NSRect abs_bounds; guint n_rects; @@ -87,6 +88,17 @@ abs_bounds = [self convertRect:[self bounds] toView:nil]; n_rects = cairo_region_num_rectangles (region); + /* First, we create a clip region for the transparent region to use so that + * we dont end up exposing too much other than the corners on CSD. + */ + transparent_clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { + abs_bounds.origin.x, abs_bounds.origin.y, + abs_bounds.size.width, abs_bounds.size.height + }); + cairo_region_subtract (transparent_clip, region); + [(GdkMacosCairoSubview *)self->transparent setClip:transparent_clip]; + cairo_region_destroy (transparent_clip); + /* The common case (at least for opaque windows and CSD) is that we will * have either one or two opaque rectangles. If we detect that the same * number of them are available as the previous, we can just resize the |