diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-09-02 09:53:02 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-04 13:00:26 +1000 |
| commit | d0a7cd759d4741a1ae118d579c90704410cde244 (patch) | |
| tree | 3cf2825f7d8def89ea38aae83b433c4c8784c4f2 | |
| parent | 535b3789be3a7b43b5d9026e2b5150521d91e32b (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>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
| -rw-r--r-- | dix/events.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/dix/events.c b/dix/events.c index 4e21c2df2..0f5b042e3 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3360,7 +3360,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; @@ -3372,15 +3376,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, @@ -3390,7 +3394,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 |
