From 023f959e6812e63f9d38b078158275bc13d238ae Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 26 May 2009 14:56:40 +1000 Subject: 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. --- Xi/exevents.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Xi/exevents.c') 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; } } -- cgit v1.2.3