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.
This commit is contained in:
Peter Hutterer 2009-05-26 14:56:40 +10:00
parent b3463fd6a8
commit 023f959e68
1 changed files with 8 additions and 4 deletions

View File

@ -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;
}
}