winex11.drv: Added missing mouse position clipping. (try 2)

Vitaliy Margolen wine-devel at
Thu Jan 21 10:03:41 CST 2010

Lauri Kenttä wrote:
> The new series of patches has some related changes (including a new test) applied before this one.
You have some issues in your test as well. The SetCursorPos() calls hooks on
Wine because Wine has big issue - it doesn't filter pointer move messages
that were caused by Wine itself. What you did in your patch is a half fix
the wrong way.

> Could you please elaborate that "so many"?
I can't give you all the programs/games that depend on particular behavior -
there are big number of them.

> I'm aware that my version causes hooks to be called with clipped
> coordinates on mouse move, when they should in that case be called with
> the unclipped ones.
This particular change will break all games using dinput when mouse pointer
goes outside of virtual desktop.

> returns unclipped coordinates from GetCursorPos
This is what native will do inside hook handler. Add some tests.

> and even sends incorrect WM_* messages.
Tests please.

> This is clearly wrong and causes many problems (example: border
> scrolling is next to impossible in many full-screen games when played on
> Wine virtual desktop).
What exactly is wrong with them? And what part are you trying to fix?

> I sincerely think my version is less likely to break anything. Surely
> there are more applications using WM_* and GetCursorPos than hooks.
This is not a reason to break anything. You either fix things without
breaking anything else. Or you don't touch the code at all.

> Anyone could do exactly the same thing "manually" by calling SetCursorPos,
> so why shouldn't ClipCursor do it automatically? Also, apparently Wine
> won't (or can't) warp the mouse if it lies outside the virtual desktop.
Number of reasons:
- Who said that Wine should keep the pointer inside virtual desktop? It's
there for the exact reason so users can have other apps running outside of
Wine at the same time as full-screen game inside Wine.
- You doing it wrong. Warping pointer is not the right way. If you really
must do it, then you should be using pointer grab. Also you are not dealing
with all the extra pointer move messages generated as a result of


More information about the wine-devel mailing list