mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 12:50:04 +01:00
mi: handle DGA subtypes when determining the master device.
The subtype in the DGA event is the core type and all ET_ event types (where
applicable) are identical to the core types. Thus the switch statement below
will work as required and assign the right master device.
Fixes a crasher bug on keyboard devices with valuators. If a device sends a
motion event while grabbed and a DGA client is active (but has not selected
input through DGA), the valuator event is posted through the VCK and
eventually results in a NULL-pointer dereference on dev->valuator.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 31ab9f8860)
This commit is contained in:
parent
e1e37ef7eb
commit
faecab3b13
1 changed files with 7 additions and 1 deletions
|
|
@ -320,6 +320,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
|
||||||
{
|
{
|
||||||
DeviceIntPtr mdev;
|
DeviceIntPtr mdev;
|
||||||
int len = original->any.length;
|
int len = original->any.length;
|
||||||
|
int type = original->any.type;
|
||||||
|
|
||||||
CHECKEVENT(original);
|
CHECKEVENT(original);
|
||||||
|
|
||||||
|
|
@ -327,7 +328,12 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
|
||||||
if (!sdev || !sdev->u.master)
|
if (!sdev || !sdev->u.master)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch(original->any.type)
|
#if XFreeXDGA
|
||||||
|
if (type == ET_DGAEvent)
|
||||||
|
type = original->dga_event.subtype;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
switch(type)
|
||||||
{
|
{
|
||||||
case ET_KeyPress:
|
case ET_KeyPress:
|
||||||
case ET_KeyRelease:
|
case ET_KeyRelease:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue