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
This commit is contained in:
Florian Müllner 2016-06-23 12:30:47 +02:00
parent 65cc1c711a
commit c61dfa71ed

View File

@ -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);