summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubutton.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-09-17 09:50:03 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-09-17 09:50:03 -0400
commite34467a375f3877ea79a618b8f9ee85f79cdf2c7 (patch)
treec069f40f986031876222c9b2ba6e43aed209b07e /gtk/gtkmenubutton.c
parent50e5323e51e9cbeb875314258d07467b5151a784 (diff)
downloadgtk+-e34467a375f3877ea79a618b8f9ee85f79cdf2c7.tar.gz
menubutton: set DROPDOWN_MENU hint on the menu toplevel
Restore the behavior introduced in 598163e52684019e4975c3d4ca728a54b00c2f74, which regressed in commit 5a3442bf9c470736c8846534607be5825c22410b.
Diffstat (limited to 'gtk/gtkmenubutton.c')
-rw-r--r--gtk/gtkmenubutton.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index b5f7547957..0edd78b7ca 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -249,6 +249,7 @@ menu_position_up_down_func (GtkMenu *menu,
{
GtkMenuButtonPrivate *priv = menu_button->priv;
GtkWidget *widget = GTK_WIDGET (menu_button);
+ GtkWidget *toplevel;
GtkRequisition menu_req;
GtkTextDirection direction;
GdkRectangle monitor;
@@ -258,6 +259,16 @@ menu_position_up_down_func (GtkMenu *menu,
GtkAllocation allocation, arrow_allocation;
GtkAlign align;
+ /* In the common case the menu button is showing a dropdown menu, set the
+ * corresponding type hint on the toplevel, so the WM can omit the top side
+ * of the shadows.
+ */
+ if (priv->arrow_type == GTK_ARROW_DOWN)
+ {
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (priv->popup));
+ gtk_window_set_type_hint (GTK_WINDOW (toplevel), GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU);
+ }
+
gtk_widget_get_preferred_size (GTK_WIDGET (priv->popup),
&menu_req, NULL);