+
+ if (event->button > 3) { // scroll wheel events! don't paint...
+ if (ui.use_xinput && !gtk_check_version(2, 17, 0) && event->button <= 7) {
+ /* with GTK+ 2.17 and later, the entire widget hierarchy is xinput-aware,
+ so the core button event gets discarded and the scroll event never
+ gets processed by the main window. This is arguably a GTK+ bug.
+ We work around it. */
+ scroll_event.scroll.type = GDK_SCROLL;
+ scroll_event.scroll.window = event->window;
+ scroll_event.scroll.send_event = event->send_event;
+ scroll_event.scroll.time = event->time;
+ scroll_event.scroll.x = event->x;
+ scroll_event.scroll.y = event->y;
+ scroll_event.scroll.state = event->state;
+ scroll_event.scroll.device = event->device;
+ scroll_event.scroll.x_root = event->x_root;
+ scroll_event.scroll.y_root = event->y_root;
+ if (event->button == 4) scroll_event.scroll.direction = GDK_SCROLL_UP;
+ else if (event->button == 5) scroll_event.scroll.direction = GDK_SCROLL_DOWN;
+ else if (event->button == 6) scroll_event.scroll.direction = GDK_SCROLL_LEFT;
+ else scroll_event.scroll.direction = GDK_SCROLL_RIGHT;
+ gtk_widget_event(GET_COMPONENT("scrolledwindowMain"), &scroll_event);
+ }
+ return FALSE;
+ }
+ if ((event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK)) != 0) return FALSE;
+ // no control-clicking or alt-clicking
+ if (!is_core) gdk_device_get_state(event->device, event->window, event->axes, NULL);
+ // synaptics touchpads send bogus axis values with ButtonDown