diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2011-12-11 18:46:50 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2012-03-01 16:25:22 -0500 |
commit | 5139617b91004c0aaa69da0ffa56dfc832bddacb (patch) | |
tree | 5ebc4c3b0fa8bfca395155942c284bc29b3c3d3e /gtk/gtkmenushell.c | |
parent | 51189ae260699f63862a3136a552ad369d4e336a (diff) | |
download | gtk+-5139617b91004c0aaa69da0ffa56dfc832bddacb.tar.gz |
menus: Handle item selection for touch devices dynamically
Instead of using gtk-touchscreen-mode, the behavior changes depending
on the source device in use.
Diffstat (limited to 'gtk/gtkmenushell.c')
-rw-r--r-- | gtk/gtkmenushell.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index b74f424e93..8077f0fd36 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -1083,13 +1083,11 @@ gtk_menu_shell_enter_notify (GtkWidget *widget, if (!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->priv->submenu)) { - gboolean touchscreen_mode; + GdkDevice *source_device; - g_object_get (gtk_widget_get_settings (widget), - "gtk-touchscreen-mode", &touchscreen_mode, - NULL); + source_device = gdk_event_get_source_device ((GdkEvent *) event); - if (touchscreen_mode) + if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH) _gtk_menu_item_popup_submenu (menu_item, TRUE); } } |