summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-09-20 15:03:05 +1000
committerChase Douglas <chase.douglas@ubuntu.com>2010-11-05 10:42:18 -0400
commit4e3d0abacc7b8d8e2ac742ab8931a4b3655ee1c8 (patch)
tree6359e25b0e01ced8e05c261ea902ed935eed31da
parent3230859304acab19d8e5291287504f54f2ae2085 (diff)
Input: Pass sprite instead of device to XYToWindow
XYToWindow calculates the position of the cursor and updates the sprite trace, but does nothing else with the device. Pass a SpritePtr instead so we can update an alternate focus instead of hardcoding the device's sprite. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--dix/events.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/dix/events.c b/dix/events.c
index f7781cea7..0f98914fd 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -335,7 +335,7 @@ IsMaster(DeviceIntPtr dev)
}
static WindowPtr XYToWindow(
- DeviceIntPtr pDev,
+ SpritePtr pSprite,
int x,
int y
);
@@ -1277,6 +1277,7 @@ ComputeFreezes(void)
{
DeviceIntPtr replayDev = syncEvents.replayDev;
int i;
+ SpritePtr pSprite = replayDev->spriteInfo->sprite;
WindowPtr w;
GrabPtr grab;
DeviceIntPtr dev;
@@ -1293,7 +1294,7 @@ ComputeFreezes(void)
syncEvents.replayDev = (DeviceIntPtr)NULL;
- w = XYToWindow(replayDev, event->root_x, event->root_y);
+ w = XYToWindow(pSprite, event->root_x, event->root_y);
for (i = 0; i < replayDev->spriteInfo->sprite->spriteTraceGood; i++)
{
if (syncEvents.replayWin ==
@@ -2582,15 +2583,13 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
* @returns the window at the given coordinates.
*/
static WindowPtr
-XYToWindow(DeviceIntPtr pDev, int x, int y)
+XYToWindow(SpritePtr pSprite, int x, int y)
{
WindowPtr pWin;
BoxRec box;
- SpritePtr pSprite;
- pSprite = pDev->spriteInfo->sprite;
pSprite->spriteTraceGood = 1; /* root window still there */
- pWin = RootWindow(pDev)->firstChild;
+ pWin = pSprite->spriteTrace[0]->firstChild;
while (pWin)
{
if ((pWin->mapped) &&
@@ -2802,7 +2801,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
ev->root_y = pSprite->hot.y;
}
- newSpriteWin = XYToWindow(pDev, pSprite->hot.x, pSprite->hot.y);
+ newSpriteWin = XYToWindow(pSprite, pSprite->hot.x, pSprite->hot.y);
if (newSpriteWin != prevSpriteWin)
{