[gtk+] menuitem: Position submenus properly



commit 5f2ef59d6968f311abe3ebf9f477120240c1acb2
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 25 04:49:12 2011 +0200

    menuitem: Position submenus properly
    
    Now that we can actually query the menu's size, don't query the
    preferred minimum size and hope it's correct, but use its actual size.

 gtk/gtkmenuitem.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index e342bd9..b7405bb 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -2147,9 +2147,8 @@ gtk_menu_item_position_menu (GtkMenu  *menu,
 
   direction = gtk_widget_get_direction (widget);
 
-  gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
-  twidth = requisition.width;
-  theight = requisition.height;
+  twidth = gtk_widget_get_allocated_width (GTK_WIDGET (menu));
+  theight = gtk_widget_get_allocated_width (GTK_WIDGET (menu));
 
   screen = gtk_widget_get_screen (GTK_WIDGET (menu));
   monitor_num = gdk_screen_get_monitor_at_window (screen, priv->event_window);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]