]> Pileus Git - ~andy/gtk/commitdiff
menubutton: set DROPDOWN_MENU hint on the menu toplevel
authorCosimo Cecchi <cosimoc@gnome.org>
Wed, 4 Jul 2012 19:41:55 +0000 (15:41 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 5 Jul 2012 14:16:42 +0000 (10:16 -0400)
So the WM can render the menu shadows correctly, omitting the top side,
in the common case the menu is rendered down from a toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=679449

gtk/gtkmenubutton.c

index 63bea8c824d86acde5b20f405cf6123f8052d391..7224f60a43d8c9543a3c283a75a7ed244f8b4894 100644 (file)
@@ -147,6 +147,10 @@ menu_position_down_func (GtkMenu         *menu,
   GdkScreen *screen;
   GdkWindow *window;
   GtkAllocation allocation, arrow_allocation;
+  GtkWidget *toplevel;
+
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (priv->menu));
+  gtk_window_set_type_hint (GTK_WINDOW (toplevel), GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU);
 
   gtk_widget_get_preferred_size (GTK_WIDGET (priv->menu),
                                  &menu_req, NULL);