Bug 30068 - XWarpPointer sends wrong raw mouse input event.
Summary: XWarpPointer sends wrong raw mouse input event.
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: unspecified
Hardware: All All
: medium major
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
Depends on:
Reported: 2010-09-07 13:01 UTC by Mad Fish
Modified: 2011-07-04 19:20 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

warptest.c (2.19 KB, text/x-csrc)
2010-09-07 13:01 UTC, Mad Fish
no flags Details

Description Mad Fish 2010-09-07 13:01:20 UTC
Created attachment 38530 [details]

XWarpPointer should generate Motion but not RawMotion (it's RAW, right?). And it definitely generates wrong RawMotion, because it contains valuators' values equal to absolute screen coordinates of mouse move target (and that is definitely wrong, since all other mouse events are relative).

So, my point is that XWarpPointer shouldn't generate RawMotion events at all.

Steps to reproduce (tested on X server 1.8 and 1.9):

I've attached a minimal test case for this.
Compile as: "gcc warptest.c -o warptest -lX11 -lXi"
This program listens for RawMotion events and calls XWarpPointer every 10th event.
You will see a series of normal events, and then a wrong event generated by XWarpPointer.
Comment 1 austinenglish@gmail.com 2011-05-30 14:29:22 UTC
This bug appears to affect several games under Wine, now that Wine uses xinput2 when available. See:
Comment 2 David Heidelberg (okias) 2011-06-20 15:46:17 UTC
Is this bug fixed? Could someone at least comment it?

Thank you
Comment 3 Peter Hutterer 2011-06-26 17:42:59 UTC
Comment 4 Mad Fish 2011-06-27 04:21:38 UTC
Thanks, Peter, for taking care of this, finally. I was too lazy to dig into X server code myself. Is this already submitted to master branch? Will this be available in bug-fix releases of old servers? I need to know when I will be able to drop workaround in my code.
Comment 5 Julien Cristau 2011-07-02 09:23:44 UTC
Fixed in master, closing.

commit 23a783278963919778d017965542e0f983814e37
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 24 11:02:23 2011 +1000

    input: add POINTER_NORAW to avoid generation of raw events (#30068)
    RawEvents are supposed to be events coming from the driver. When warping the
    pointer, this should not generate a raw event.
    X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Comment 6 David Heidelberg (okias) 2011-07-02 15:32:16 UTC
may I ask for backporting this patch into older version Xserver with XI2?

Thank you
Comment 7 Peter Hutterer 2011-07-04 19:20:36 UTC
it'll be in 1.10.4

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.