[gtk+] gdk/x11: Drop motion/button events emulated from touch
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk/x11: Drop motion/button events emulated from touch
- Date: Tue, 19 Sep 2017 17:19:22 +0000 (UTC)
commit 6fd905e4e1ba4d692a3e39ef7e81cb3c4c534e84
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon May 29 12:16:21 2017 +0200
gdk/x11: Drop motion/button events emulated from touch
We now always listen to touch events. Just avoid delivering both
types of events.
gdk/x11/gdkdevicemanager-xi2.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 20cb4f4..36e3e02 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1582,6 +1582,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
}
else
{
+#ifdef XINPUT_2_2
+ if (xev->flags & XIPointerEmulated)
+ return FALSE;
+#endif
event->button.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
event->button.window = window;
@@ -1621,11 +1625,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->button.button = xev->detail;
}
-#ifdef XINPUT_2_2
- if (xev->flags & XIPointerEmulated)
- gdk_event_set_pointer_emulated (event, TRUE);
-#endif
-
if (return_val == FALSE)
break;
@@ -1697,6 +1696,11 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
break;
}
+#ifdef XINPUT_2_2
+ if (xev->flags & XIPointerEmulated)
+ return FALSE;
+#endif
+
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
event->motion.time = xev->time;
@@ -1712,11 +1716,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->motion.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
-#ifdef XINPUT_2_2
- if (xev->flags & XIPointerEmulated)
- gdk_event_set_pointer_emulated (event, TRUE);
-#endif
-
/* There doesn't seem to be motion hints in XI */
event->motion.is_hint = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]