[gtk+] menu: Clip children to view window
- From: Lapo Calamandrei <lapo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] menu: Clip children to view window
- Date: Thu, 24 Mar 2016 19:26:13 +0000 (UTC)
commit cd78fa15eda0638180ba5ffd4d6eccb2cbfefb86
Author: Benjamin Otte <otte redhat com>
Date: Thu Mar 24 19:50:45 2016 +0100
menu: Clip children to view window
Don't overdraw the arrow allocations.
https://bugzilla.gnome.org/show_bug.cgi?id=764118
gtk/gtkmenu.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index cdf2aec..a811a23 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]