diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-26 14:56:40 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-27 13:54:19 +1000 |
commit | 023f959e6812e63f9d38b078158275bc13d238ae (patch) | |
tree | 8d1ab289869cae68a2f407e7d04081732e0648b9 /Xi/exevents.c | |
parent | b3463fd6a89d50a7562c357aeb5314ce0fd6493d (diff) |
Xi: fix an inputInfo.keyboard usage.
In the case of a RevertToFollowKeyboard, the master device should be used
(since this is the closest equivalent to the VCK as before). Only if the
master keyboard is the same as the device, revert to the VCK itself.
Diffstat (limited to 'Xi/exevents.c')
-rw-r--r-- | Xi/exevents.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 2bcc2e103..83891f87f 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1846,16 +1846,20 @@ DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev) dev->focus->traceGood = 0; break; case RevertToFollowKeyboard: - if (inputInfo.keyboard->focus->win) { - DoFocusEvents(dev, pWin, inputInfo.keyboard->focus->win, - focusEventMode); + { + DeviceIntPtr kbd = GetMaster(dev, MASTER_KEYBOARD); + if (!kbd || (kbd == dev && kbd != inputInfo.keyboard)) + kbd = inputInfo.keyboard; + if (kbd->focus->win) { + DoFocusEvents(dev, pWin, kbd->focus->win, focusEventMode); dev->focus->win = FollowKeyboardWin; dev->focus->traceGood = 0; } else { - DoFocusEvents(dev, pWin, NoneWin, focusEventMode); + DoFocusEvents(dev, pWin, NoneWin, focusEventMode); dev->focus->win = NoneWin; dev->focus->traceGood = 0; } + } break; } } |