[gtk+] menu: Only realize menu if it isn't realized yet



commit 3ecb308e569dc2107b44bd2572acfcc1da85a2eb
Author: Benjamin Otte <otte redhat com>
Date:   Thu May 19 12:51:13 2011 +0200

    menu: Only realize menu if it isn't realized yet
    
    Lots of code calls gtk_menu_popup() and we don't want to resize the
    window needlessly.
    In this particular case, keyboard navigation to submenus caused those
    submenus to shrink.
    
    Note: I'm not sure this fix doesn't have nasty side effects, as I'm not
    a specialist on menu popup code, so if it does, we'll need to revert it.
    Until then, let's keep it, it fixes a bug.

 gtk/gtkmenu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 59b8056..b6e4ee8 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1678,6 +1678,7 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
   /* Compute the size of the toplevel and realize it so we
    * can scroll correctly.
    */
+  if (!gtk_widget_get_realized (GTK_WIDGET (menu)))
   {
     GtkRequisition tmp_request;
     GtkAllocation tmp_allocation = { 0, };



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