dix: set core and button state based on the touch state
If a pointer-emulating touch caused a button to be logically down, set that state in the input events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
parent
dbfd7b37a0
commit
634b0da9a8
|
@ -663,6 +663,8 @@ int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd)
|
||||||
/* core state needs to be assembled BEFORE the device is updated. */
|
/* core state needs to be assembled BEFORE the device is updated. */
|
||||||
corestate = (kbd && kbd->key) ? XkbStateFieldFromRec(&kbd->key->xkbInfo->state) : 0;
|
corestate = (kbd && kbd->key) ? XkbStateFieldFromRec(&kbd->key->xkbInfo->state) : 0;
|
||||||
corestate |= (mouse && mouse->button) ? (mouse->button->state) : 0;
|
corestate |= (mouse && mouse->button) ? (mouse->button->state) : 0;
|
||||||
|
corestate |= (mouse && mouse->touch) ? (mouse->touch->state) : 0;
|
||||||
|
|
||||||
return corestate;
|
return corestate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,6 +676,9 @@ void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event)
|
||||||
if (BitIsOn(mouse->button->down, i))
|
if (BitIsOn(mouse->button->down, i))
|
||||||
SetBit(event->buttons, i);
|
SetBit(event->buttons, i);
|
||||||
|
|
||||||
|
if (mouse && mouse->touch && mouse->touch->buttonsDown > 0)
|
||||||
|
SetBit(event->buttons, mouse->button->map[1]);
|
||||||
|
|
||||||
if (kbd && kbd->key)
|
if (kbd && kbd->key)
|
||||||
{
|
{
|
||||||
XkbStatePtr state;
|
XkbStatePtr state;
|
||||||
|
|
Loading…
Reference in New Issue