From 9b5daf90944623f9e5f82ae329cb00cac15ea42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 Jun 2016 12:30:47 +0200 Subject: [PATCH] frames: Don't clip out "invisible" parts of frames The GTK+ theme may draw parts of the decorations outside the actual frame. Since commit f9db65f47f we make sure that the frame is big enough to account for any overdrawing, however as we still clip the cairo context to the actual frame before drawing the decorations, those parts aren't actually painted. This issue is not very obvious for most frames, as they use a non-rgba visual where the unpainted parts appear black, which gives the expected result with many themes once the shape mask is applied (as the mask does include any overdrawn parts). For frames using an rgba visual however, unpainted parts are transparent, so any overdrawn decorations are clearly missing. Fix this by only clipping out the client area when drawing decorations. https://bugzilla.gnome.org/show_bug.cgi?id=745060 --- src/ui/frames.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ui/frames.c b/src/ui/frames.c index 4296862b9..746fdea65 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -1292,7 +1292,7 @@ get_visible_frame_border_region (MetaUIFrame *frame) MetaFrameFlags flags; MetaFrameType type; MetaFrameBorders borders; - MetaRectangle frame_rect = frame->meta_window->rect; + MetaRectangle buffer_rect = frame->meta_window->buffer_rect; flags = meta_frame_get_flags (frame->meta_window->frame); type = meta_window_get_frame_type (frame->meta_window); @@ -1301,19 +1301,19 @@ get_visible_frame_border_region (MetaUIFrame *frame) type, frame->text_height, flags, &borders); - /* Visible frame rect */ - area.x = borders.invisible.left; - area.y = borders.invisible.top; - area.width = frame_rect.width; - area.height = frame_rect.height; + /* Frame rect */ + area.x = 0; + area.y = 0; + area.width = buffer_rect.width; + area.height = buffer_rect.height; frame_border = cairo_region_create_rectangle (&area); /* Client rect */ - area.x += borders.visible.left; - area.y += borders.visible.top; - area.width -= borders.visible.left + borders.visible.right; - area.height -= borders.visible.top + borders.visible.bottom; + area.x += borders.total.left; + area.y += borders.total.top; + area.width -= borders.total.left + borders.total.right; + area.height -= borders.total.top + borders.total.bottom; /* Visible frame border */ cairo_region_subtract_rectangle (frame_border, &area);