1
From ab60cadc2afb9d8882144e30fde11c3ef0f999cd Mon Sep 17 00:00:00 2001
2
From: Chase Douglas <chase.douglas@canonical.com>
3
Date: Fri, 3 Feb 2012 16:19:05 -0800
4
Subject: [PATCH] Store window pointer in touch listener record
6
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10
dix/touch.c | 16 ++++++++++------
11
include/input.h | 3 ++-
12
include/inputstr.h | 1 +
13
3 files changed, 13 insertions(+), 7 deletions(-)
15
diff --git a/dix/touch.c b/dix/touch.c
16
index db0bf33..b42859d 100644
19
@@ -697,12 +697,14 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
22
TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
23
- enum TouchListenerType type, enum TouchListenerState state)
24
+ enum TouchListenerType type, enum TouchListenerState state,
27
ti->listeners[ti->num_listeners].listener = resource;
28
ti->listeners[ti->num_listeners].level = level;
29
ti->listeners[ti->num_listeners].state = state;
30
ti->listeners[ti->num_listeners].type = type;
31
+ ti->listeners[ti->num_listeners].window = window;
35
@@ -753,7 +755,7 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
38
TouchAddListener(ti, grab->resource, grab->grabtype,
39
- type, LISTENER_AWAITING_BEGIN);
40
+ type, LISTENER_AWAITING_BEGIN, grab->window);
44
@@ -814,7 +816,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
45
TouchEventHistoryAllocate(ti);
47
TouchAddListener(ti, iclients->resource, XI2,
48
- type, LISTENER_AWAITING_BEGIN);
49
+ type, LISTENER_AWAITING_BEGIN, win);
53
@@ -830,7 +832,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
55
TouchEventHistoryAllocate(ti);
56
TouchAddListener(ti, iclients->resource, XI,
57
- LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
58
+ LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
63
@@ -845,7 +848,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
65
TouchEventHistoryAllocate(ti);
66
TouchAddListener(ti, win->drawable.id, CORE,
67
- LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
68
+ LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
73
@@ -857,7 +861,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
75
TouchEventHistoryAllocate(ti);
76
TouchAddListener(ti, iclients->resource, CORE,
77
- type, LISTENER_AWAITING_BEGIN);
78
+ type, LISTENER_AWAITING_BEGIN, win);
82
diff --git a/include/input.h b/include/input.h
83
index fb45617..53645b4 100644
86
@@ -613,7 +613,8 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
87
extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
88
extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
89
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
90
- enum TouchListenerType type, enum TouchListenerState state);
91
+ enum TouchListenerType type, enum TouchListenerState state,
93
extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
94
extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev);
95
extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
96
diff --git a/include/inputstr.h b/include/inputstr.h
97
index c3297db..4e28bc7 100644
98
--- a/include/inputstr.h
99
+++ b/include/inputstr.h
100
@@ -314,6 +314,7 @@ typedef struct _TouchPointInfo {
101
enum TouchListenerType type;
102
enum TouchListenerState state;
103
enum InputLevel level; /* matters only for emulating touches */
107
int num_grabs; /* number of open grabs on this touch