dix: allow grab modifier device to be NULL.
This can happen if we check for a passive core grab and our device is a floating slave device. Doesn't really change anything as SDs can't send core events but it stops the server from segfaulting.
This commit is contained in:
parent
5a7a65a3c9
commit
23365d2865
17
dix/events.c
17
dix/events.c
|
@ -3379,7 +3379,7 @@ CheckPassiveGrabsOnWindow(
|
||||||
{
|
{
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
DeviceIntPtr gdev;
|
DeviceIntPtr gdev;
|
||||||
XkbSrvInfoPtr xkbi;
|
XkbSrvInfoPtr xkbi = NULL;
|
||||||
|
|
||||||
gdev= grab->modifierDevice;
|
gdev= grab->modifierDevice;
|
||||||
if (grab->coreGrab)
|
if (grab->coreGrab)
|
||||||
|
@ -3389,7 +3389,8 @@ CheckPassiveGrabsOnWindow(
|
||||||
else
|
else
|
||||||
gdev = device;
|
gdev = device;
|
||||||
}
|
}
|
||||||
xkbi= gdev->key->xkbInfo;
|
if (gdev)
|
||||||
|
xkbi= gdev->key->xkbInfo;
|
||||||
#endif
|
#endif
|
||||||
tempGrab.modifierDevice = grab->modifierDevice;
|
tempGrab.modifierDevice = grab->modifierDevice;
|
||||||
if ((device == grab->modifierDevice) &&
|
if ((device == grab->modifierDevice) &&
|
||||||
|
@ -3400,16 +3401,20 @@ CheckPassiveGrabsOnWindow(
|
||||||
))
|
))
|
||||||
tempGrab.modifiersDetail.exact =
|
tempGrab.modifiersDetail.exact =
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
(noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods);
|
(noXkbExtension) ?
|
||||||
|
((gdev) ? gdev->key->prev_state : 0) :
|
||||||
|
((xkbi) ? xkbi->state.grab_mods : 0);
|
||||||
#else
|
#else
|
||||||
grab->modifierDevice->key->prev_state;
|
(gdev) ? gdev->key->prev_state : 0;
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
tempGrab.modifiersDetail.exact =
|
tempGrab.modifiersDetail.exact =
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
(noXkbExtension ? gdev->key->state : xkbi->state.grab_mods);
|
(noXkbExtension) ?
|
||||||
|
((gdev) ? gdev->key->state : 0) :
|
||||||
|
((xkbi) ? xkbi->state.grab_mods : 0);
|
||||||
#else
|
#else
|
||||||
grab->modifierDevice->key->state;
|
(gdev) ? gdev->key->state : 0;
|
||||||
#endif
|
#endif
|
||||||
/* ignore the device for core events when comparing grabs */
|
/* ignore the device for core events when comparing grabs */
|
||||||
if (GrabMatchesSecond(&tempGrab, grab, (xE->u.u.type < LASTEvent)) &&
|
if (GrabMatchesSecond(&tempGrab, grab, (xE->u.u.type < LASTEvent)) &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user