Store window pointer in touch listener record

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Chase Douglas 2012-02-03 16:19:05 -08:00 committed by Peter Hutterer
parent f92ba92adf
commit ab60cadc2a
3 changed files with 13 additions and 7 deletions

View File

@ -697,12 +697,14 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
*/ */
void void
TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level, TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
enum TouchListenerType type, enum TouchListenerState state) enum TouchListenerType type, enum TouchListenerState state,
WindowPtr window)
{ {
ti->listeners[ti->num_listeners].listener = resource; ti->listeners[ti->num_listeners].listener = resource;
ti->listeners[ti->num_listeners].level = level; ti->listeners[ti->num_listeners].level = level;
ti->listeners[ti->num_listeners].state = state; ti->listeners[ti->num_listeners].state = state;
ti->listeners[ti->num_listeners].type = type; ti->listeners[ti->num_listeners].type = type;
ti->listeners[ti->num_listeners].window = window;
ti->num_listeners++; ti->num_listeners++;
} }
@ -753,7 +755,7 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
} }
TouchAddListener(ti, grab->resource, grab->grabtype, TouchAddListener(ti, grab->resource, grab->grabtype,
type, LISTENER_AWAITING_BEGIN); type, LISTENER_AWAITING_BEGIN, grab->window);
ti->num_grabs++; ti->num_grabs++;
} }
@ -814,7 +816,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, XI2, TouchAddListener(ti, iclients->resource, XI2,
type, LISTENER_AWAITING_BEGIN); type, LISTENER_AWAITING_BEGIN, win);
return TRUE; return TRUE;
} }
} }
@ -830,7 +832,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, XI, TouchAddListener(ti, iclients->resource, XI,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN); LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win);
return TRUE; return TRUE;
} }
} }
@ -845,7 +848,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
{ {
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, win->drawable.id, CORE, TouchAddListener(ti, win->drawable.id, CORE,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN); LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win);
return TRUE; return TRUE;
} }
@ -857,7 +861,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, CORE, TouchAddListener(ti, iclients->resource, CORE,
type, LISTENER_AWAITING_BEGIN); type, LISTENER_AWAITING_BEGIN, win);
return TRUE; return TRUE;
} }
} }

View File

@ -613,7 +613,8 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource); extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource); extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level, extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
enum TouchListenerType type, enum TouchListenerState state); enum TouchListenerType type, enum TouchListenerState state,
WindowPtr window);
extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource); extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev); extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev);
extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,

View File

@ -314,6 +314,7 @@ typedef struct _TouchPointInfo {
enum TouchListenerType type; enum TouchListenerType type;
enum TouchListenerState state; enum TouchListenerState state;
enum InputLevel level; /* matters only for emulating touches */ enum InputLevel level; /* matters only for emulating touches */
WindowPtr window;
} *listeners; } *listeners;
int num_listeners; int num_listeners;
int num_grabs; /* number of open grabs on this touch int num_grabs; /* number of open grabs on this touch