mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-03 11:40:15 +01:00
dix: don't create core motion events for non-x/y valuators.
Devices that send motion events with valuators other than x/y get core
motion events with unchanged x/y coordinates. This confuses some
applications.
If the DeviceEvent does not have the x/y valuators set, return BadMatch on
core conversion, thus skipping the event altogether.
Reported-by: Bartosz Brachaczek <b.brachaczek@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Bartosz Brachaczek <b.brachaczek@gmail.com>
(cherry picked from commit de8be07cc0)
This commit is contained in:
parent
e3769c20d5
commit
79f2a58c32
1 changed files with 9 additions and 0 deletions
|
|
@ -102,6 +102,15 @@ EventToCore(InternalEvent *event, xEvent *core)
|
|||
switch(event->any.type)
|
||||
{
|
||||
case ET_Motion:
|
||||
{
|
||||
DeviceEvent *e = &event->device_event;
|
||||
/* Don't create core motion event if neither x nor y are
|
||||
* present */
|
||||
if (!BitIsOn(e->valuators.mask, 0) &&
|
||||
!BitIsOn(e->valuators.mask, 1))
|
||||
return BadMatch;
|
||||
}
|
||||
/* fallthrough */
|
||||
case ET_ButtonPress:
|
||||
case ET_ButtonRelease:
|
||||
case ET_KeyPress:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue