-
- Downloads
dix: pick the right keyboard for focus FollowKeyboard
This fixes a crash when we try to send focus events and dereference FollowKeyboardWin (0x3) as WindowPtr. A device set to XSetDeviceFocus(FollowKeyboard) is supposed to follow the focus of the corresponding master device. During ActivateKeyboard a slave device is detached from the master for the duration for the grab so we don't actually have a master to follow - leaving our oldWin set to the FollowKeyboardWin constant. This later crashes when we try to dereference it. Fix this by getting the current master (if any), or the saved master (if temporarily detached due to a grab). And if failing that, use the VCK as fallback device - that is technically wrong but it's such a niche use case that it shouldn't matter. Reproducer: window = XCreateSimpleWindow(...) deviceid = any device that is IsXExtensionKeyboard device XSetDeviceFocus(deviceid, FollowKeyboard, ...) XGrabDevice(deviceid, window, ...) Fixes: f01ee198 ("dix: don't use inputInfo.keyboard to get the focus window in ActivateKbdGrab") Found-by:Olivier Fourdan <ofourdan@redhat.com> Acked-by:
Olivier Fourdan <ofourdan@redhat.com> Tested-by:
Olivier Fourdan <ofourdan@redhat.com> Part-of: <!1870>
Loading
Please register or sign in to comment