menu: Clip children to view window

Don't overdraw the arrow allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=764118
This commit is contained in:
Benjamin Otte 2016-03-24 19:50:45 +01:00 committed by Lapo Calamandrei
parent 31a032e042
commit cd78fa15ed

View File

@ -3011,7 +3011,19 @@ gtk_menu_draw (GtkWidget *widget,
gtk_css_gadget_draw (priv->bottom_arrow_gadget, cr);
}
GTK_WIDGET_CLASS (gtk_menu_parent_class)->draw (widget, cr);
if (gtk_cairo_should_draw_window (cr, priv->bin_window))
{
int x, y;
gdk_window_get_position (priv->view_window, &x, &y);
cairo_rectangle (cr,
x, y,
gdk_window_get_width (priv->view_window),
gdk_window_get_height (priv->view_window));
cairo_clip (cr);
GTK_WIDGET_CLASS (gtk_menu_parent_class)->draw (widget, cr);
}
return FALSE;
}