Generate a WM_MOUSEMOVE event when warping the mouse

Roderick Colenbrander thunderbird2k at gmail.com
Sat Oct 31 11:50:58 CDT 2009


On Sat, Oct 31, 2009 at 5:37 PM, JesusFreke <jesusfreke at jesusfreke.com> wrote:
>
>
> On Sat, Oct 31, 2009 at 11:00 AM, Vitaliy Margolen <wine-devel at kievinfo.com>
> wrote:
>>
>> JesusFreke wrote:
>> > ---
>> >  dlls/winex11.drv/mouse.c |    1 +
>> >  1 files changed, 1 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
>> > index 60351e5..7c24c64 100644
>> > --- a/dlls/winex11.drv/mouse.c
>> > +++ b/dlls/winex11.drv/mouse.c
>> > @@ -1004,6 +1004,7 @@ BOOL CDECL X11DRV_SetCursorPos( INT x, INT y )
>> >      XFlush( display ); /* avoids bad mouse lag in games that do their
>> > own mouse warping */
>> >      cursor_pos = pt;
>> >      wine_tsx11_unlock();
>> > +    queue_raw_mouse_message( WM_MOUSEMOVE, NULL, x, y, 0,
>> > GetCurrentTime(), 0, 0 );
>> >      return TRUE;
>> >  }
>> >
>> Can you explain why do you need this patch? What exactly is it fixing? And
>> have you run any tests to verify this? I'm guessing no, because you
>> ignored
>> that Wine will generate mouse-move event when this operation comes back to
>> Wine from X server.
>
> Sorry, first time posting a patch. I thought I had included a introduction
> to the patch with git send-email.
>
> In any case, this is to fix a mouse issue in AION. The issue occurs when you
> right-click and drag, which moves the camera. The game frequently warps the
> mouse back to the center of the screen, and the camera movement is very
> jittery, like it might if you had manually moved the mouse back to the
> center of the screen (instantly). Another symptom is that if you begin the
> right-click drag near the top or the bottom of the screen, the camera will
> instantly pan down or up, like you had instantly dragged from the start
> location to the center of the y-axis.
>
> I'll be honest, I don't know if this is the correct way to fix this issue.
> But with this patch, the mouse movement is working perfectly.
>
> If you have any suggestions for a better fix, I would be happy to code it up
> and test it out with Aion.
>
> (sorry for the double-email Vitaliy - I just realized that I didn't
> reply-all. And yeah, I know top posting is generally frowned upon. Sorry! :)
> )
>

I don't know this code that well but to me it looked like a hack as
well (as I guess it will also send that event back to the app and the
app shouldn't hear anything about our hacks.). These the days issue
can be fixed properly on the latest Xservers which support xinput2. We
need to add support for it to Wine and that would fix the issue
properly. The problem is that the current code needs to be redesigned
quite a bit (some part needs to be moved to explorer I believe) and
then the new code can be added. Paul Hampton did a lot of work on this
a while ago but I think he didn't have time to finish it. He must have
code for it and if you want you could continue it (perhaps with his
assistance) but it takes some effort I think.

Roderick



More information about the wine-devel mailing list