diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2016-05-09 08:56:56 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2016-05-10 15:58:02 +0200 |
commit | 126156e820789557ae05af6a6b76c40e3c1c2325 (patch) | |
tree | 266bb3892b2f5f03375109aeaf760562af221b8d /gtk/gtkmenu.c | |
parent | c134d52dd789d2f8b43e15e51fa72d9586a151ec (diff) | |
download | gtk+-126156e820789557ae05af6a6b76c40e3c1c2325.tar.gz |
gtkmenu: ignore left/right scroll events
Menus are placed vertically by definition, it does not make much sense
to support horizontal axis for scrolling.
Use GDK_EVENT_STOP/GDK_EVENT_PROPAGATE instead of TRUE/FALSE and add a
default case to return GDK_EVENT_PROPAGATE for unhandled events.
https://bugzilla.gnome.org/show_bug.cgi?id=765939
Diffstat (limited to 'gtk/gtkmenu.c')
-rw-r--r-- | gtk/gtkmenu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index ee24b724cc..78275d291b 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -3557,24 +3557,25 @@ gtk_menu_scroll (GtkWidget *widget, GtkMenu *menu = GTK_MENU (widget); if (_gdk_event_get_pointer_emulated ((GdkEvent *) event)) - return FALSE; + return GDK_EVENT_PROPAGATE; switch (event->direction) { - case GDK_SCROLL_RIGHT: case GDK_SCROLL_DOWN: gtk_menu_scroll_by (menu, MENU_SCROLL_STEP2); break; - case GDK_SCROLL_LEFT: case GDK_SCROLL_UP: gtk_menu_scroll_by (menu, - MENU_SCROLL_STEP2); break; case GDK_SCROLL_SMOOTH: gtk_menu_scroll_by (menu, event->delta_y * MENU_SCROLL_STEP2); break; + default: + return GDK_EVENT_PROPAGATE; + break; } - return TRUE; + return GDK_EVENT_STOP; } static void |