diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 7c93bbba06..e84c1e3c46 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -1104,6 +1104,12 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->scroll.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group); break; } + /* Button presses of button 4-7 are scroll events, so ignore the release */ + else if (ev->evtype == XI_ButtonRelease) + { + return_val = FALSE; + break; + } /* else (XI_ButtonRelease) fall thru */ default: event->button.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE; @@ -1141,6 +1147,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->button.button = xev->detail; } + if (return_val == FALSE) + break; + if (!set_screen_from_root (display, event, xev->root)) { return_val = FALSE;