summaryrefslogtreecommitdiff
path: root/gtk/gtkmenu.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-03-24 19:50:45 +0100
committerLapo Calamandrei <calamandrei@gmail.com>2016-03-24 20:25:49 +0100
commitcd78fa15eda0638180ba5ffd4d6eccb2cbfefb86 (patch)
tree12bdcda0c9d2521abdada74b216d279c73b43042 /gtk/gtkmenu.c
parent31a032e04285418b4db306c83feb99c12add5f91 (diff)
downloadgtk+-cd78fa15eda0638180ba5ffd4d6eccb2cbfefb86.tar.gz
menu: Clip children to view window
Don't overdraw the arrow allocations. https://bugzilla.gnome.org/show_bug.cgi?id=764118
Diffstat (limited to 'gtk/gtkmenu.c')
-rw-r--r--gtk/gtkmenu.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index cdf2aecb2e..a811a234e6 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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;
}