mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 10:10:05 +01:00
xfree86: Sanity check before retrieving the paired device.
Some pointer devices send key events [1], blindly getting the paired device crashes the server. So let's check if the device is a pointer before we try to get the paired device. [1] The MS Wireless Optical Desktop 2000's multimedia keys are sent through the pointer device, not through the keyboard device.
This commit is contained in:
parent
5a4c6621aa
commit
df2545b98d
1 changed files with 4 additions and 1 deletions
|
|
@ -722,7 +722,10 @@ xf86PostKeyboardEvent(DeviceIntPtr device,
|
|||
int index;
|
||||
|
||||
#if XFreeXDGA
|
||||
DeviceIntPtr pointer = GetPairedDevice(device);
|
||||
DeviceIntPtr pointer;
|
||||
|
||||
/* Some pointers send key events, paired device is wrong then. */
|
||||
pointer = IsPointerDevice(device) ? device : GetPairedDevice(device);
|
||||
|
||||
if (miPointerGetScreen(pointer)) {
|
||||
index = miPointerGetScreen(pointer)->myNum;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue