summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-12-14 17:02:30 +1000
committerChase Douglas <chase.douglas@canonical.com>2011-12-21 10:34:12 -0800
commitbdfbf9e1e48bebbba4f9434ba257c6320626f35b (patch)
tree523e72bd14134960ef426a74f019e783456108f6
parent637d7108e915dafce862510dbc8a9e36ff21c0fd (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>
-rw-r--r--dix/events.c10
-rw-r--r--include/input.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/dix/events.c b/dix/events.c
index b65067e70..51300cb37 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3644,11 +3644,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;
@@ -3720,7 +3724,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;
@@ -3944,7 +3948,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;
diff --git a/include/input.h b/include/input.h
index a6bdce060..9fec92b96 100644
--- a/include/input.h
+++ b/include/input.h
@@ -634,7 +634,7 @@ void FixUpEventFromWindow(SpritePtr pSprite,
extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab,
- InternalEvent *ev);
+ InternalEvent *ev, InternalEvent *real_event);
/**
* Masks specifying the type of event to deliver for an InternalEvent; used
* by EventIsDeliverable.