dix: refuse events from disabled devices.
If the device is disabled ("off"), it must not send events to a client. The driver shouldn't send events in that case anyway, but just to make sure we simply drop events coming while the device is disabled. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
47a89b1cba
commit
c2785ae7eb
|
@ -835,6 +835,10 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
|
||||||
DeviceEvent *event;
|
DeviceEvent *event;
|
||||||
RawDeviceEvent *raw;
|
RawDeviceEvent *raw;
|
||||||
|
|
||||||
|
/* refuse events from disabled devices */
|
||||||
|
if (!pDev->enabled)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed ||
|
if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed ||
|
||||||
(type != KeyPress && type != KeyRelease) ||
|
(type != KeyPress && type != KeyRelease) ||
|
||||||
(key_code < 8 || key_code > 255))
|
(key_code < 8 || key_code > 255))
|
||||||
|
@ -997,6 +1001,10 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
cx, cy; /* only screen coordinates */
|
cx, cy; /* only screen coordinates */
|
||||||
ScreenPtr scr = miPointerGetScreen(pDev);
|
ScreenPtr scr = miPointerGetScreen(pDev);
|
||||||
|
|
||||||
|
/* refuse events from disabled devices */
|
||||||
|
if (!pDev->enabled)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ms = GetTimeInMillis(); /* before pointer update to help precision */
|
ms = GetTimeInMillis(); /* before pointer update to help precision */
|
||||||
|
|
||||||
if (!scr || !pDev->valuator || first_valuator < 0 ||
|
if (!scr || !pDev->valuator || first_valuator < 0 ||
|
||||||
|
@ -1096,6 +1104,10 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
|
||||||
int num_events = 1;
|
int num_events = 1;
|
||||||
DeviceEvent *event;
|
DeviceEvent *event;
|
||||||
|
|
||||||
|
/* refuse events from disabled devices */
|
||||||
|
if (!pDev->enabled)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Sanity checks. */
|
/* Sanity checks. */
|
||||||
if (type != ProximityIn && type != ProximityOut)
|
if (type != ProximityIn && type != ProximityOut)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue