summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-09-20 15:03:05 +1000
committerDaniel Stone <daniel@fooishbar.org>2011-01-06 17:10:41 +0000
commit690476250f58616d5156317e01ba547497f4331a (patch)
treee597aa3730ac5a0a20955dd325800b89a75b7c07 /dix
parent07a892cd8276f8092de95f1909f2ebec6f5fdf08 (diff)
Input: Pass sprite instead of device to XYToWindow, make non-static
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. Also make this function non-static, so we can use it elsewhere. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-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.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/dix/events.c b/dix/events.c
index df59a4e61..29033e2e5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -332,12 +332,6 @@ IsMaster(DeviceIntPtr dev)
return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
}
-static WindowPtr XYToWindow(
- DeviceIntPtr pDev,
- int x,
- int y
-);
-
/**
* Max event opcode.
*/
@@ -1290,7 +1284,8 @@ ComputeFreezes(void)
syncEvents.replayDev = (DeviceIntPtr)NULL;
- w = XYToWindow(replayDev, event->root_x, event->root_y);
+ w = XYToWindow(replayDev->spriteInfo->sprite,
+ event->root_x, event->root_y);
if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin))
{
if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
@@ -2553,16 +2548,14 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
*
* @returns the window at the given coordinates.
*/
-static WindowPtr
-XYToWindow(DeviceIntPtr pDev, int x, int y)
+WindowPtr
+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 = GetCurrentRootWindow(pDev)->firstChild;
+ pWin = RootWindow(pSprite)->firstChild;
while (pWin)
{
if ((pWin->mapped) &&
@@ -2775,7 +2768,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)
{