#ifdef HAVE_XINPUT2
XIDeviceEvent *xev = (XIDeviceEvent *) event->xcookie.data;
- if (event->type == GenericEvent) /* XI_ButtonPress or XI_ButtonRelease */
+ if (event->type == GenericEvent) /* XI_ButtonPress or XI_ButtonRelease or a touch event. */
{
if (! (xev->event_x >= 0
&& xev->event_x < FRAME_PIXEL_WIDTH (f)
list = gtk_container_get_children (GTK_CONTAINER (x->menubar_widget));
if (! list) return 0;
int scale = xg_get_scale (f);
- rec.x = event->xbutton.x / scale;
- rec.y = event->xbutton.y / scale;
+#ifdef HAVE_XINPUT2
+ if (event->type == GenericEvent)
+ {
+ rec.x = xev->event_x / scale;
+ rec.y = xev->event_y / scale;
+ }
+ else
+ {
+#else
+ rec.x = event->xbutton.x / scale;
+ rec.y = event->xbutton.y / scale;
+#endif
+#ifdef HAVE_XINPUT2
+ }
+#endif
rec.width = 1;
rec.height = 1;
if (f && device->direct_p)
{
+ *finish = X_EVENT_DROP;
x_catch_errors (dpyinfo->display);
XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
xev->detail, xev->event, XIAcceptTouch);