summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-09-02 09:53:02 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-07 14:11:51 +1000
commita4d9b235d5072bbe8e8b59e0dff68bb34aec96ed (patch)
treed777ae0481fbf3b50aabb695d357a23db0126601
parent04350feafc43ba6f4cbc378ae0cd6a405fa97ad9 (diff)
dix: NewCurrentScreen must work on pointers where possible
When a screen switch is triggered by PointerKeys, the device for NewCurrentScreen is the keyboard. Submitting pointer events for this keyboard (without valuators) has no effect as GPE ignores the event. Force the dequeuing through the XTest device attached to this device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/events.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/dix/events.c b/dix/events.c
index 5193f07dd..c36c7cc25 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3361,7 +3361,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;
@@ -3373,15 +3377,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,
@@ -3391,7 +3395,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