aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index c5f435c11..587724e16 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -525,13 +525,6 @@ SyntheticMotion(DeviceIntPtr dev, int x, int y) {
static void PostNewCursor(DeviceIntPtr pDev);
static Bool
-pointOnScreen(ScreenPtr pScreen, int x, int y)
-{
- return x >= pScreen->x && x < pScreen->x + pScreen->width &&
- y >= pScreen->y && y < pScreen->y + pScreen->height;
-}
-
-static Bool
XineramaSetCursorPosition(
DeviceIntPtr pDev,
int x,
@@ -550,13 +543,13 @@ XineramaSetCursorPosition(
x += screenInfo.screens[0]->x;
y += screenInfo.screens[0]->y;
- if(!pointOnScreen(pScreen, x, y))
+ if(!point_on_screen(pScreen, x, y))
{
FOR_NSCREENS(i)
{
if(i == pScreen->myNum)
continue;
- if(pointOnScreen(screenInfo.screens[i], x, y))
+ if(point_on_screen(screenInfo.screens[i], x, y))
{
pScreen = screenInfo.screens[i];
break;
@@ -3366,7 +3359,11 @@ WindowHasNewCursor(WindowPtr pWin)
void
NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
{
- SpritePtr pSprite = pDev->spriteInfo->sprite;
+ DeviceIntPtr ptr;
+ SpritePtr pSprite;
+
+ ptr = IsFloating(pDev) ? pDev : GetXTestDevice(GetMaster(pDev, MASTER_POINTER));
+ pSprite = ptr->spriteInfo->sprite;
pSprite->hotPhys.x = x;
pSprite->hotPhys.y = y;
@@ -3378,15 +3375,15 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
pSprite->screen = newScreen;
/* Make sure we tell the DDX to update its copy of the screen */
if(pSprite->confineWin)
- XineramaConfineCursorToWindow(pDev,
+ XineramaConfineCursorToWindow(ptr,
pSprite->confineWin, TRUE);
else
- XineramaConfineCursorToWindow(pDev, screenInfo.screens[0]->root, TRUE);
+ XineramaConfineCursorToWindow(ptr, screenInfo.screens[0]->root, TRUE);
/* if the pointer wasn't confined, the DDX won't get
told of the pointer warp so we reposition it here */
if(!syncEvents.playingEvents)
(*pSprite->screen->SetCursorPosition)(
- pDev,
+ ptr,
pSprite->screen,
pSprite->hotPhys.x + screenInfo.screens[0]->x -
pSprite->screen->x,
@@ -3396,7 +3393,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
} else
#endif
if (newScreen != pSprite->hotPhys.pScreen)
- ConfineCursorToWindow(pDev, newScreen->root, TRUE, FALSE);
+ ConfineCursorToWindow(ptr, newScreen->root, TRUE, FALSE);
}
#ifdef PANORAMIX