Xi: check button mapping value _before_ assigning it
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
parent
a1304d6cb6
commit
631516a4aa
|
@ -1002,11 +1002,9 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
deactivateDeviceGrab = TRUE;
|
deactivateDeviceGrab = TRUE;
|
||||||
break;
|
break;
|
||||||
case ET_ButtonPress:
|
case ET_ButtonPress:
|
||||||
event->detail.button = b->map[key];
|
if (b->map[key] == 0) /* there's no button 0 */
|
||||||
if (!event->detail.button) { /* there's no button 0 */
|
|
||||||
event->detail.button = key;
|
|
||||||
return;
|
return;
|
||||||
}
|
event->detail.button = b->map[key];
|
||||||
if (!grab && CheckDeviceGrabs(device, event, 0))
|
if (!grab && CheckDeviceGrabs(device, event, 0))
|
||||||
{
|
{
|
||||||
/* if a passive grab was activated, the event has been sent
|
/* if a passive grab was activated, the event has been sent
|
||||||
|
@ -1015,11 +1013,9 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ET_ButtonRelease:
|
case ET_ButtonRelease:
|
||||||
event->detail.button = b->map[key];
|
if (b->map[key] == 0) /* there's no button 0 */
|
||||||
if (!event->detail.button) { /* there's no button 0 */
|
|
||||||
event->detail.button = key;
|
|
||||||
return;
|
return;
|
||||||
}
|
event->detail.button = b->map[key];
|
||||||
if (grab && !b->buttonsDown &&
|
if (grab && !b->buttonsDown &&
|
||||||
device->deviceGrab.fromPassiveGrab &&
|
device->deviceGrab.fromPassiveGrab &&
|
||||||
(device->deviceGrab.grab->type == ButtonPress ||
|
(device->deviceGrab.grab->type == ButtonPress ||
|
||||||
|
|
Loading…
Reference in New Issue