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

Lauri Kenttä lauri.kentta at
Thu Jan 21 06:10:56 CST 2010

Thanks for your comments, Vitaliy.

At first, I must point out that you're commenting on a patch that has
already been superseded. Not that there's much difference, but the new
series of patches has some related changes (including a new test) applied
before this one.

Vitaliy Margolen wrote:
> Lots of those areas you touch will break oh so many apps.

Could you please elaborate that "so many"?

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. Still, please note that the current version calls all
hooks (not just on mouse move) with the unclipped coordinates, returns
unclipped coordinates from GetCursorPos and even sends incorrect WM_*
messages. 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).

I sincerely think my version is less likely to break anything. Surely
there are more applications using WM_* and GetCursorPos than hooks.

Maybe I will have time to fix the remaining bugs some day. I will also try
to write some Wine tests so that these problems (be they in my version or
the old one) are not forgotten.

Vitaliy Margolen wrote:
> And don't try to keep pointer inside Wine's window

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.

As I see it, clipping should first be implemented correctly, because
that's what Windows applications expect. Then, if this causes problems, we
could use a registry key similar to DXGrab to disable (or restrict)
XWarpPointer usage.

Lauri Kenttä

More information about the wine-devel mailing list