summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-01-03 09:26:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-01-03 13:21:55 +1000
commit997ae0343730c66d581fd147741cbe27fbe55af2 (patch)
treed130f636224332b24b0396382e3c3b248851b9f2
parent5ee845c1bf457159a034111c3d0df584aa600cd6 (diff)
Set a flag on the pointer-emulating touch event
Toolkits need to know which touch event emulated a pointer event and which ones do not. To quote Carlos Garnacho: GTK+ does client-side windows by default (GdkWindows without a backing X window), for this to work the toplevel window in the client needs to select for more events that it wouldn't normally select for in order to cater for the event masks in such child "windows". This means that ideally GTK+ should set the touch events mask in the toplevel, and then find out whether the "window" would receive pointer or touch events for the sequence emulating the pointer, and perform the emulation itself. Reported-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--XI2.h1
-rw-r--r--specs/XI2proto.txt8
2 files changed, 7 insertions, 2 deletions
diff --git a/XI2.h b/XI2.h
index 4368006..e864b06 100644
--- a/XI2.h
+++ b/XI2.h
@@ -158,6 +158,7 @@
#define XIPointerEmulated (1 << 16)
/* Device event flags (touch events only) */
#define XITouchPendingEnd (1 << 16)
+#define XITouchEmulatingPointer (1 << 17)
/* Touch modes */
#define XIDirectTouch 1
diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
index 8e2eea8..6ab2559 100644
--- a/specs/XI2proto.txt
+++ b/specs/XI2proto.txt
@@ -505,7 +505,8 @@ window set has been reached, the event is delivered:
- otherwise, to the next parent window in the window set until a selection has
been found.
-Emulated pointer events will have the PointerEmulated flag set.
+Emulated pointer events will have the PointerEmulated flag set. A touch
+event that emulates pointer events has the TouchEmulatingPointer flag set.
[[glossary-notations]]
Notations used in this document
@@ -2048,7 +2049,8 @@ For a detailed description of classes, see the XIQueryDevice request.
DEVICEEVENTFLAGS (all events): none
DEVICEEVENTFLAGS (key events only): { KeyRepeat }
DEVICEEVENTFLAGS (pointer events only): { PointerEmulated }
- DEVICEEVENTFLAGS (touch events only): { TouchPendingEnd }
+ DEVICEEVENTFLAGS (touch events only): { TouchPendingEnd,
+ TouchEmulatingPointer }
An XIDeviceEvent is generated whenever the logical state of a device
changes in response to a button press, a button release, a motion, a key
@@ -2108,6 +2110,8 @@ KeyRelease, ButtonPress, ButtonRelease, Motion.
accepted or passed on ownership. The touch will not generate any
further TouchUpdate events once an event with TouchPendingEnd has been
received.
+ TouchEmulatingPointer is set on touch events that emulate pointer
+ events.
Modifier state in mods is detailed as follows: