aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <agarcia@igalia.com>2009-08-28 12:43:03 +0200
committerAlberto Garcia <agarcia@igalia.com>2009-08-28 17:42:07 +0200
commit905902b4ef3a95bc3ac583aa5c9f13eb5d74c942 (patch)
tree090fb73f10cdeea03e018f068acb8762994b5a75
parente02ddf8d5b80790867aa37284bb5ec87a4271936 (diff)
Close HildonAppMenu if it receives a grab-notify signal
* hildon/hildon-app-menu.c (+hildon_app_menu_grab_notify, hildon_app_menu_class_init): Close the menu if it receives a grab-notify signal. Fixes: NB#134533 (UI freezes if we show a dialog with gtk_dialog_run() while a menu is opened)
-rw-r--r--ChangeLog9
-rw-r--r--hildon/hildon-app-menu.c12
2 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 63f0672..1121c04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-28 Alberto Garcia <agarcia@igalia.com>
+
+ * hildon/hildon-app-menu.c
+ (+hildon_app_menu_grab_notify, hildon_app_menu_class_init):
+ Close the menu if it receives a grab-notify signal.
+
+ Fixes: NB#134533 (UI freezes if we show a dialog with
+ gtk_dialog_run() while a menu is opened)
+
2009-08-27 Alejandro G. Castro <alex@igalia.com>
* hildon/hildon-pannable-area.c,
diff --git a/hildon/hildon-app-menu.c b/hildon/hildon-app-menu.c
index fa39c89..7247e7a 100644
--- a/hildon/hildon-app-menu.c
+++ b/hildon/hildon-app-menu.c
@@ -523,6 +523,17 @@ hildon_app_menu_map (GtkWidget *widget)
priv->find_intruder_idle_id = gdk_threads_add_idle (hildon_app_menu_find_intruder, widget);
}
+static void
+hildon_app_menu_grab_notify (GtkWidget *widget,
+ gboolean was_grabbed)
+{
+ if (GTK_WIDGET_CLASS (hildon_app_menu_parent_class)->grab_notify)
+ GTK_WIDGET_CLASS (hildon_app_menu_parent_class)->grab_notify (widget, was_grabbed);
+
+ if (!was_grabbed && GTK_WIDGET_VISIBLE (widget))
+ gtk_widget_hide (widget);
+}
+
static gboolean
hildon_app_menu_hide_idle (gpointer widget)
{
@@ -956,6 +967,7 @@ hildon_app_menu_class_init (HildonAppMenuClass *klass)
widget_class->map = hildon_app_menu_map;
widget_class->realize = hildon_app_menu_realize;
widget_class->unrealize = hildon_app_menu_unrealize;
+ widget_class->grab_notify = hildon_app_menu_grab_notify;
widget_class->key_press_event = hildon_app_menu_key_press;
widget_class->style_set = hildon_app_menu_style_set;
widget_class->delete_event = hildon_app_menu_delete_event_handler;