Commit 126156e8 authored by Olivier Fourdan's avatar Olivier Fourdan

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
parent c134d52d
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment