Don't call gtk_widget_show() when adding items to HildonAppMenu
authorAlberto Garcia <agarcia@igalia.com>
Mon, 20 Apr 2009 18:27:12 +0000 (20:27 +0200)
committerAlberto Garcia <agarcia@igalia.com>
Mon, 25 May 2009 15:37:05 +0000 (17:37 +0200)
* hildon/hildon-app-menu.c
(hildon_app_menu_insert, hildon_app_menu_add_filter):
Don't call gtk_widget_show() on added items.

Fixes: NB#109063 (HildonAppMenu shouldn't show its items
automatically when they're added)

ChangeLog
hildon/hildon-app-menu.c

index 0dcacf2..badf912 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-25  Alberto Garcia  <agarcia@igalia.com>
+
+       * hildon/hildon-app-menu.c
+       (hildon_app_menu_insert, hildon_app_menu_add_filter):
+       Don't call gtk_widget_show() on added items.
+
+       Fixes: NB#109063 (HildonAppMenu shouldn't show its items
+       automatically when they're added)
+
 2009-05-20  Alberto Garcia  <agarcia@igalia.com>
 
        * hildon/hildon-banner.c
index 178586a..1c9b3c4 100644 (file)
@@ -178,10 +178,10 @@ hildon_app_menu_insert                          (HildonAppMenu *menu,
                                       HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
 
     /* Add the item to the menu */
-    gtk_widget_show (GTK_WIDGET (item));
     g_object_ref_sink (item);
     priv->buttons = g_list_insert (priv->buttons, item, position);
-    hildon_app_menu_repack_items (menu, position);
+    if (GTK_WIDGET_VISIBLE (item))
+        hildon_app_menu_repack_items (menu, position);
 
     /* Enable accelerators */
     g_signal_connect (item, "can-activate-accel", G_CALLBACK (can_activate_accel), NULL);
@@ -285,10 +285,10 @@ hildon_app_menu_add_filter                      (HildonAppMenu *menu,
                                       HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
 
     /* Add the filter to the menu */
-    gtk_widget_show (GTK_WIDGET (filter));
     g_object_ref_sink (filter);
     priv->filters = g_list_append (priv->filters, filter);
-    hildon_app_menu_repack_filters (menu);
+    if (GTK_WIDGET_VISIBLE (filter))
+        hildon_app_menu_repack_filters (menu);
 
     /* Enable accelerators */
     g_signal_connect (filter, "can-activate-accel", G_CALLBACK (can_activate_accel), NULL);