From: Luc Pionchon Date: Sun, 28 May 2006 22:44:01 +0000 (+0000) Subject: * hildon-widgets/hildon-app.c (hildon_app_key_snooper): Add code to control if there... X-Git-Tag: 2.1.66-1~1183 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=beedbabe7cb8efe79aabcbf833100f58776eacaf;p=hildon * hildon-widgets/hildon-app.c (hildon_app_key_snooper): Add code to control if there is a combobox activated when the menu key is pressed and prevent the menu drawing. NB#26383 --- diff --git a/ChangeLog b/ChangeLog index a69f9b6..431f99b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2006-05-29 Luc Pionchon + * hildon-widgets/hildon-app.c + (hildon_app_key_snooper): Add code to control if there is a + combobox activated when the menu key is pressed and prevent the + menu drawing. + + NB#26383 + + +2006-05-29 Luc Pionchon + * hildon-widgets/hildon-banner.c (hildon_banner_set_property): Set max_width hint to -1 instead of HILDON_BANNER_LABEL_MAX_TIMED when banner is timed to avoid. This diff --git a/hildon-widgets/hildon-app.c b/hildon-widgets/hildon-app.c index a35a332..d504d69 100644 --- a/hildon-widgets/hildon-app.c +++ b/hildon-widgets/hildon-app.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #include @@ -1501,10 +1503,28 @@ hildon_app_key_snooper (GtkWidget *widget, GdkEventKey *keyevent, HildonApp *app if ( HILDON_KEYEVENT_IS_MENU_KEY (keyevent) ) { HildonAppView *appview; HildonAppPrivate *priv; - GtkWidget *toplevel; - + GtkWidget *toplevel; + GtkWidget *focus = NULL; + /* Don't act on modal dialogs */ toplevel = gtk_widget_get_toplevel (widget); + focus = gtk_window_get_focus(GTK_WINDOW(app)); + + /* Don't act when comboboxes are active, if a togglebutton + (combobox) has the focus and it is active, we deactivate the + combobox and do nothing */ + if (GTK_IS_TOGGLE_BUTTON (focus)) + { + GtkWidget *parent = gtk_widget_get_parent (focus); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (focus)) && + GTK_IS_COMBO_BOX (parent)) + { + gtk_combo_box_popdown (GTK_COMBO_BOX (parent)); + return TRUE; + } + } + if (GTK_IS_DIALOG (toplevel) && gtk_window_get_modal (GTK_WINDOW (toplevel))) {