summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-12-14 17:02:30 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-21 12:38:36 +1000
commitc3843f5498a849920ab68cca3557411ad8ab3454 (patch)
treefb88e2d67bef8af05fad6a6181d80ddf25614805 /dix
parente389a19a730055d4550ff708da83c78099a516fd (diff)
dix: add real_event parameter to ActivatePassiveGrab
For touch events with pointer emulation, the event that triggers the grab (the pointer event) is not the same as the actual event (the touch event). For replaying, we need to store the real event then. No effective changes at this point, for the current caller event and real_event are identical. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/dix/events.c b/dix/events.c
index f8ea94f8e..d8530efc5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3643,11 +3643,15 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
* @param device The device of the event to check.
* @param grab The grab to check.
* @param event The current device event.
+ * @param real_event The original event, in case of touch emulation. The
+ * real event is the one stored in the sync queue.
*
* @return Whether the grab has been activated.
*/
Bool
-ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event)
+ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
+ InternalEvent *real_event)
+
{
SpritePtr pSprite = device->spriteInfo->sprite;
GrabInfoPtr grabinfo = &device->deviceGrab;
@@ -3719,7 +3723,7 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event)
if (grabinfo->sync.state == FROZEN_NO_EVENT)
grabinfo->sync.state = FROZEN_WITH_EVENT;
- *grabinfo->sync.event = event->device_event;
+ *grabinfo->sync.event = real_event->device_event;
free(xE);
return TRUE;
@@ -3943,7 +3947,7 @@ CheckPassiveGrabsOnWindow(
if (!CheckPassiveGrab(device, grab, event, checkCore, tempGrab))
continue;
- if (activate && !ActivatePassiveGrab(device, grab, event))
+ if (activate && !ActivatePassiveGrab(device, grab, event, event))
continue;
break;