XWarpPointer sends wrong raw mouse input event - jumping mouse when XInput2 in use

Bug #792598 reported by Dan Kegel
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Wine
Fix Released
Medium
X.Org X server
Fix Released
High
xorg-server (Ubuntu)
Fix Released
High
Bryce Harrington

Bug Description

From https://bugs.freedesktop.org/show_bug.cgi?id=30068
"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."

He also includes a small testcase.

Happens in Ubuntu 10.10 and 11.04 (or any Ubuntu with XInput2 support).
Affects apps that use xinput2, e.g. wine as of roughly wine-1.3.20 or later.

Drives users nuts... the main menu of Bioshock Demo and many other
games is nearly completely useless because of the jumping mouse
when xinput2 is used; see http://bugs.winehq.org/show_bug.cgi?id=27156

The lead Wine developer, Alexandre Julliard, has been waiting for this bug to be fixed for some time now. He's trying to work around it, without much luck so far.

Revision history for this message
In , Austin English (austinenglish) wrote :

Regression from 1.3.19:
fd4ad5a60433b8314dce684b9d52f43769cd5867 is the first bad commit
commit fd4ad5a60433b8314dce684b9d52f43769cd5867
Author: Alexandre Julliard <email address hidden>
Date: Fri May 13 12:40:19 2011 +0200

    winex11: Don't use raw events for button events so that we get the right coordinates.

:040000 040000 d046b97119984a1e2a0591144ff6ed2bc15e3ea4 465eb2f383428394793525fde1d7f7934da0d08a M dlls

the option in winecfg to allow fullscreen windows to grab the mouse makes no difference.

You can use the custom argument '-nointro' to skip the intro videos and get straight to the menu.

Revision history for this message
In , Removed by request (removed1836289) wrote :

Possible dupe: bug 27158

Revision history for this message
In , Rocko (rockorequin) wrote :

In call of duty 4 I get the crazy jumping mouse in 1.3.20, but only if the option to allow fullscreen windows to grab the mouse is set. I'm emulating a virtual desktop if that makes a difference.

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27161 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27158 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jchevrier (jchevrier) wrote :

This bug also affects Unreal Tournament (UT99) in full screen mode (regardless of the setting of "Automatically capture the mouse in full-screen windows"). The mouse works as expected if you configure a virtual desktop.

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27179 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27182 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Removed by request (removed1836289) wrote :

Major, affects many game.

Revision history for this message
In , Gyebro69 (gyebro69) wrote :

In current git (wine-1.3.20-44-gddad22d) the mouse problem is fixed in Half-Life 2 and Counter-Strike:Source.

Revision history for this message
In , L29Ah (zl29ah) wrote :

(In reply to comment #9)
> In current git (wine-1.3.20-44-gddad22d) the mouse problem is fixed in
> Half-Life 2 and Counter-Strike:Source.

Just compiled it from git and observe the crosshair pointing into ground at random times.

Revision history for this message
In , Elton (elton) wrote :

I still have jumpy mouse in wine-1.3.20-44-gddad22d, e.g. in Half-Life.
Compiling using --without-xinput2 provides a workaround.

Revision history for this message
In , Austin English (austinenglish) wrote :

Bioshock is fixed by:
http://source.winehq.org/git/wine.git/commitdiff/0e2b4f99a9f5d97f8da0189037b7516cf1585d45

for me with Xserver 1.9.4.

though I'm going to leave this open for a few more days, since at least Source games may still affected by the original commit.

Revision history for this message
In , Austin English (austinenglish) wrote :

Increasing severity.

Revision history for this message
In , Joško (dinamo-forever) wrote :

This also affects Warcraft III (RoC & TFT) games. Mouse scrolling and mouse movement is really bad.

Revision history for this message
In , Winehq-org (winehq-org) wrote :

(In reply to comment #12)

Source games look to be fixed here - tested todays git with L4D2.

Revision history for this message
In , Jchevrier (jchevrier) wrote :

Unreal Tournament's menu screen appears fixed with today's git. I'm having an occasional look at the floor issue (you're facing forward, then suddenly you're looking at the floor) that happens intermittently during game play. Not sure if this is a related issue. Guess it's off to do regression testing.

Revision history for this message
In , Wine (wine-nu) wrote :

Problems with Diablo II after upgrade from 1.3.19 to 1.3.20 aswell.

It only happens after opening an info screen either left or right (Inventory, Stats, Merc), but not when opening both sides at the same time like with the stash.

It seems dependant on the side of the screen the info screen is displayed.
When the inventory (right side) is opened the real mouse position shifts to the right. Then when the mouse is moved the cursor jumps to the actual location and from there moves the cursor the way the mouse was moved.
After closing the inventory the real mouse position shifts back to the left.

Same for an info screen on the left side. Real mouse position shift left on opening, and back right again after closing.

Also, this is only noticeable if the mouse is moved after opening or closing. If for example the inventory screen gets opened and closed while the mouse isn't moved, the mouse cursor stays at the right position.

Revision history for this message
In , Removed by request (removed1836289) wrote :

Please don't post in this bug unless you are running a Wine git clone from at least the 16th of May. Commits to fix this bug are:
9556b4f7dbf71aec2f4ebf89ec164ae91d9b43ac
0e2b4f99a9f5d97f8da0189037b7516cf1585d45
d1f5c13162d15873b2b51b28cfb56035f0890183

If it's still happening to you after these, feel free to post, otherwise not much point.

Revision history for this message
In , Rocko (rockorequin) wrote :

It's a ton better since those commits but I still find myself sometimes suddenly looking at the floor in call of duty games, usually when scrabbling around on the keyboard as well as desperately moving the mouse as I try to evade a juggernaut.

Revision history for this message
In , Alexandre Julliard (julliard) wrote :

That's most likely the XWarpPointer bug. I added a workaround but it's not foolproof. This has to be fixed on the XInput2 side.

Revision history for this message
In , Dan Kegel (dank) wrote :
Revision history for this message
In , Ivan Borzenkov (ivan1986) wrote :

*** Bug 27205 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27213 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Elton (elton) wrote :

This bug could need a better/more general title.
Is anyone from Wine lobbying to get the X11 bug fixed?

Revision history for this message
In , Rocko (rockorequin) wrote :

If the bug is in X rather than wine, why does wine 1.3.17 + xinput2 patch not exhibit the same behaviour? Does it have another workaround?

Revision history for this message
In , michael.curran (burzmali) wrote :

The Witcher still has this problem. My bisect pointed to commit a59c7cc8596b658d3c0854a737528cf60947ac1f as the problem.

Revision history for this message
In , Anders G. Jørgensen (spirit55555) wrote :

Same problem in Call of Duty. Wine 1.3.20.

Revision history for this message
In , Timwoj (timwoj) wrote :

I've patched up to the latest git (as of about 30 minutes ago) and at least Rift still exhibits the same behavior. I haven't tested anything else.

Revision history for this message
In , Roman (m01brv) wrote :

(In reply to comment #25)
> If the bug is in X rather than wine, why does wine 1.3.17 + xinput2 patch not
> exhibit the same behaviour?

It has related issues. See my comment 489 for bug 6961. It is the same problem with XWarpPointer.

In what concerns the current wine from git. For DeusEx, AvP2 mouse jumps have almost gone, but still occure suddenly sometimes.

Revision history for this message
In , Alexandre Julliard (julliard) wrote :

*** Bug 27255 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Alexandre Julliard (julliard) wrote :

*** Bug 27267 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Karabaja4-o (karabaja4-o) wrote :

It seems this bug still happens on alot of games, including:

Starcraft: Brood War (when rectangle-selecting units with mouse, after which the game crashes when you release the mouse button)

Star Wars Jedi Knight III: Jedi Academy (everywhere)

Revision history for this message
In , Karabaja4-o (karabaja4-o) wrote :

P.S. Using wine 1.3.21.

Revision history for this message
In , Evan Goers (megatog615) wrote :

This is still a problem in wine-1.3.21(actually, latest git). CounterStrike: Source and possibly every other Source engine game is affected. Seemingly at random, the mouse jumps in a way that you are instantly looking at the ground.

Revision history for this message
In , Winehq-org (winehq-org) wrote :

I can confirm what Evan said in #34.

While the problem has been significantly reduced, it does occasionally and randomly still seem to change where you're looking in Source games. I tested with L4D2 and the current git.

Revision history for this message
In , Wine-9 (wine-9) wrote :

*** Bug 27319 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Axel-f (axel-f) wrote :

I can confirm this bug in Portal2. It happens in the git version I've installed today.
Informations: wine-1.3.21, Gentoo Linux 2.6.36-gentoo-r5 #3 SMP Sat Mar 26 17:53:26 CET 2011 x86_64 Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz GenuineIntel GNU/Linux nvidia-drivers-260.19.36 and it happens often when you play the game causing unexpected deaths! :P

Revision history for this message
In , Nelson-3 (nelson-3) wrote :

confirm on wine 1.3.21 mouse jumping randomly in Day of Defeat:Source
Arch Linux

strangely it was fine until a distro update for the same package (wine-1.3.21-1 -> wine-1.3.21-2) nothing special has changed (only added a dependency in package data, no build option changed)

more interestingly, i think back in 1.3.19 or 1.3.20, about the time gcc 4.6.0 released, i tried to compile wine with gcc 4.6, the bug occurs. (it was fine when i built it with gcc 4.5.x
but i believe both wine-1.3.21-1 and 1.3.21-2 of arch linux are built with gcc 4.6
this cant explain why it works fine with 1.3.21-1

maybe some combination of other libraries contribute to the bug? maybe gcc?

Revision history for this message
In , Winehq-org (winehq-org) wrote :

(In reply to comment #38)
> strangely it was fine until a distro update for the same package

The older version was probably built using --without-xinput2 on the .configure command.

28 comments hidden view all 108 comments
Revision history for this message
In , rot13 (pp) wrote :

(In reply to comment #61)
> So, uhh, I've found a proposal by Peter Hutterer on fixing this bug and tried
> to write a rough fix for xorg-server 1.9.5
> http://paste.pocoo.org/show/401098/

This patch fixes Red Faction, Wine from current git with patch for bug #27406.

Without your patch every mouse movement causes the character to immediately look at the ground and rotate around at high speed. With the patch it works properly, and mouse look is silky smooth (without xi2 it's a bit jerky).

Good work!

Revision history for this message
In , Klamoshnikprogrammer (klamoshnikprogrammer) wrote :

> (In reply to comment #61)
> So, uhh, I've found a proposal by Peter Hutterer on fixing this bug and tried
> to write a rough fix for xorg-server 1.9.5
> http://paste.pocoo.org/show/401098/

Doesn't seem to fix it for me... :(
wine-1.3.21 fixed problem with 360 degrees rotating for Crysis 1 with "grab" option, but Half-Life 1 has mouse lag issue when clicking mouse. Only solved with virtual desktop option which is quite hacky way.

Revision history for this message
In , Austin English (austinenglish) wrote :

*** Bug 27420 has been marked as a duplicate of this bug. ***

Revision history for this message
In , David Heidelberg (okias) wrote :

*** Bug 27300 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Zibeon (zibeon) wrote :

This bug still affects Counter Strike Source( wine1.3.19/20/21/22 )

Revision history for this message
In , Olivier Diotte (vhann3000) wrote :

This also affects Red Alert 2 (with or without Yuri's Revenge).

Either compiling Wine-1.3.22 with '--without-xinput2' or using wine-1.3.18 allows one to workaround the bug though.

Revision history for this message
In , Chris Rankin (rankincj) wrote :

Compiling wine 1.3.21 without XInput2 support restores mouse-sanity to World of Warcraft. My Xorg server is:

xorg-x11-server-Xorg-1.10.2-1.fc15.i686

Revision history for this message
In , Removed by request (removed3425744) wrote :

*** Bug 27225 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Lill-guill (lill-guill) wrote :

Just for info.
I have the same problem for OPERATION FLASHPOINT GOTY WITH WINE 1.3.21

description: updated
tags: added: regression-release
Changed in xorg-server:
importance: Unknown → High
status: Unknown → Confirmed
Changed in wine:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , David Philippi (david-torangan) wrote :

Just to increase the count of games: Dungeons and Dragons online also has trouble. Running around the mouse will sometimes warp the camera down, making jump and run parts great fun.
Advantage is that this game is free to play, can be tested by everyone.

Revision history for this message
In , Jimportal (jimportal) wrote :

In today's git,

adb86c5f2a2584dc8131b08d26aef7c82910d0b5 winex11: Try harder to ignore broken raw motions events caused by pointer warping.

fixes mouse behavior for World of Warcraft (for me at least).

Revision history for this message
In , Dan Kegel (dank) wrote :

In today's git (wine-1.3.22-255-g4c0c0d3) I still get nasty jumping
in the Quake 3 Arena demo menu.

Changed in xorg-server:
status: Confirmed → In Progress
Revision history for this message
In , Evan Goers (megatog615) wrote :

Latest git fixes the problem in the Source engine as well.

Revision history for this message
In , Willian (wiltave-zipmail) wrote :

I've experienced the same issue running Wine 1.3.22 and Half-Life (Steam). I'm going to try the git version.
Thanks.

Revision history for this message
In , Evan Goers (megatog615) wrote :

(In reply to comment #81)
> I've experienced the same issue running Wine 1.3.22 and Half-Life (Steam). I'm
> going to try the git version.
> Thanks.

Yup. I played a whole 2 hours of CSS today and never experienced this bug once.

Revision history for this message
In , Netfab (netfab) wrote :

Patch for xorg-server (comment #61) is no longer necessary if wine is patched with adb86c5f2a2584dc8131b08d26aef7c82910d0b5.

Revision history for this message
In , Willian (wiltave-zipmail) wrote :

Git version fixed the issue.
Thanks.

Revision history for this message
In , Marcus Meissner (marcus-jet) wrote :

I guess we can mark this resolved then? AUstin?

Revision history for this message
In , Earns-61 (earns-61) wrote :

Please wait until 1.3.23! Few users obtain Wine through git, the most of people use Wine from repositories and cannot currently check whether this bug is fixed.

Revision history for this message
In , Alexandre Julliard (julliard) wrote :

Delaring fixed. Please open new bugs for remaining issues.

Revision history for this message
In , Austin English (austinenglish) wrote :

(In reply to comment #85)
> I guess we can mark this resolved then? AUstin?

Yes, Bioshock works fine, as do most other programs in wine-1.3.22-332-g016b7c5.

Duke Nukem Forever is still busted though, bug 27572.

Changed in wine:
status: Confirmed → Fix Released
Revision history for this message
Dan Kegel (dank) wrote : Re: XWarpPointer sends wrong raw mouse input event

We'll probably have more wine bugs to link to this one. I don't think it's time to close this yet.

Revision history for this message
In , Alexandre Julliard (julliard) wrote :

Closing bugs fixed in 1.3.23.

Revision history for this message
In , Nheart (nheart) wrote :

Bug is only fixed when using a proper mouse. It is still present when using a touchpad!

Revision history for this message
In , Wylda (wylda) wrote :

*** Bug 27455 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Austin English (austinenglish) wrote :

(In reply to comment #90)
> Bug is only fixed when using a proper mouse. It is still present when using a
> touchpad!

File a new bug please.

Revision history for this message
Dan Kegel (dank) wrote : Re: XWarpPointer sends wrong raw mouse input event

Wine has not fixed this bug; they've worked around it with great effort.

Fixing X is still worth doing, so other apps don't have to do what Wine did.

Revision history for this message
Austin English (austinenglish) wrote :
Revision history for this message
In , Austin English (austinenglish) wrote :

(In reply to comment #58)
> https://bugs.freedesktop.org/show_bug.cgi?id=30068#c1

The X.org bug has been fixed, see https://bugs.freedesktop.org/show_bug.cgi?id=30068#c5

===============
Fixed in master, closing.

commit 23a783278963919778d017965542e0f983814e37
Author: Peter Hutterer <email address hidden>
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 <email address hidden>
    Reviewed-by: Daniel Stone <email address hidden>
    Signed-off-by: Peter Hutterer <email address hidden>
===============

Revision history for this message
In , David Heidelberg (okias) wrote :

So previous solution done in wine is workaround and could be removed, do I understand right?

Thanks

Revision history for this message
In , Dan Kegel (dank) wrote :

Only once enough people have the new X, which will happen in
about 1-2 years (if we feel adventurous) or never (if we feel conservative).

Revision history for this message
In , David Heidelberg (okias) wrote :

that's really great idea, but what about backporting patch into mostly used distributions?

Changed in xorg-server:
status: In Progress → Fix Released
Revision history for this message
In , Alexandre Julliard (julliard) wrote :

*** Bug 27949 has been marked as a duplicate of this bug. ***

Bryce Harrington (bryce)
tags: added: maverick natty
summary: - XWarpPointer sends wrong raw mouse input event
+ XWarpPointer sends wrong raw mouse input event - jumping mouse when
+ XInput2 in use
Changed in xorg-server (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Dan, according to the upstream bug report this fix was included in xserver 1.10.4, which is what we're carrying in oneiric, so presumably this issue is now fixed?

Likely this is worth backporting for natty as well which also has a 1.10.x xserver; maverick may be a more challenging backport since it has xserver 1.9, but could be worth a look. But first can you confirm oneiric is working properly?

Changed in xorg-server (Ubuntu):
assignee: nobody → Bryce Harrington (bryce)
status: Triaged → Incomplete
Revision history for this message
Dan Kegel (dank) wrote :

I think it's fixed in 11.10, judging by the initial test case. (I haven't tried Wine, but my guess is that would be happy, too.)

Revision history for this message
Rocko (rockorequin) wrote :

I don't think wine is a good test case anymore - they put a workaround in wine some time ago, so it works with both 11.04 and 11.10.

Revision history for this message
Dan Kegel (dank) wrote :

Yes, I know, I would have to go back to an old version of wine to test with that.
(I suppose that's what Bryce wanted, so I probably will soon.)
But the original freedesktop.org bug report had a nice non-wine testcase that now passes.

Revision history for this message
Bryce Harrington (bryce) wrote :

Alright, from the last few comments (and no comments in the past couple months) sounds like possibly this is fully fixed now. Closing out the bug, please reopen if there's more work needed on the X side.

Changed in xorg-server (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
In , Sergey Ivanov (icegood1980) wrote :
Revision history for this message
In , Sergey Ivanov (icegood1980) wrote :

Could be closed again. It works great under XP.

Displaying first 40 and last 40 comments. View all 108 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.