[PATCH] dix: don't create core motion events for non-x/y valuators.
Robert Hooker
sarvatt at ubuntu.com
Thu Sep 30 13:00:09 PDT 2010
On Tue, Aug 17, 2010 at 1:08 AM, Bartosz Brachaczek
<b.brachaczek at gmail.com> wrote:
> 2010/8/17 Peter Hutterer <peter.hutterer at who-t.net>:
>> 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 at gmail.com>
>> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>> ---
>> dix/eventconvert.c | 9 +++++++++
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/dix/eventconvert.c b/dix/eventconvert.c
>> index 4e3de0b..0f747c1 100644
>> --- a/dix/eventconvert.c
>> +++ b/dix/eventconvert.c
>> @@ -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:
>> --
>> 1.7.2.1
>>
>>
>
> Tested-by: Bartosz Brachaczek <b.brachaczek at gmail.com>
>
> This fixes the issue for me. Thanks a lot!
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
This seems to have broken the tests on server-1.9-branch?
/xkb/set-get-rules: OK
/xkb/get-rules: OK
/xkb/set-rules: OK
PASS: xkb
/dix/input/attributes: OK
/dix/input/init-valuators: OK
/dix/input/event-core-conversion: [dix] EventToCore: Not implemented yet
[dix] EventToCore: Not implemented yet
[dix] EventToCore: Not implemented yet
**
ERROR:../../test/input.c:192:dix_event_to_core: assertion failed: (rc
== Success)
/bin/bash: line 5: 20500 Aborted ${dir}$tst
FAIL: input
/dix/xtest/init: OK
/dix/xtest/properties: OK
PASS: xtest
========================================================================
1 of 3 tests failed
Please report to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
========================================================================
It passes and builds fine after reverting this commit. Also -
https://bugs.freedesktop.org/show_bug.cgi?id=30267
More information about the xorg-devel
mailing list