[Bug 6971] Mouse "escapes" window or is confined to an area in the full screen program

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Dec 28 10:37:48 CST 2008


http://bugs.winehq.org/show_bug.cgi?id=6971


Tomasz Sałaciński <tsalacinski at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tsalacinski at gmail.com




--- Comment #199 from Tomasz Sałaciński <tsalacinski at gmail.com>  2008-12-28 10:37:40 ---
Anything new on this? I've tried to patch it, almost did it. Tried under Star
Wars: Knights of the Old Republic.

The problem is, that mouse warping SHOULD be done by winex11.drv.

The other problem is, that it cannot be in fixed positoin on the middle of the
screen, because most games won't work (like KOTOR, we cannot rely on some
function that one game does but other not). Workaround for all games seems to
me like that:

If I move the cursor outside the virtual desktop, game is not receiving any
mouse events - that's good. Warping mouse all the time will break normal
applications running in virtual desktop mode (for example, if user will click
the titlebar and try to drag the window outside of the desktop - mouse will
jump back to the middle and confuse the user)

If I right-click and try to turn, mouse cursor disappears, and the game is
receiving events event if the mouse cursor is outside of the game's screen
(checked it - MotionNotify event in winex11.drv - dumps mouse position on every
move).

There's how I did it:

Game window size is 1024x768. If the x coordinate of mouse pointer is > 1024,
then XWarpPointer moves it back to 1024 - it gives smooth turn in KOTOR (moving
it to the middle of the screen, eg. 512 makes turning choppy, because the game
thinks that user moved the mouse back to 512). The same with x < 0, if it
reaches value less than zero it jumps back to 0. Thanks to that, mouse look is
smooth in this game, user can scroll 360 ten times without moving mouse back to
the view. Mouse events are received only when mouse is grabbed, so it won't
affect normal desktop apps, and in the menu, mouse will just stop when it
reaches the edge of the screen (winex11.drv will stop it, not the xserver).

There is one disadvatange, though:
It works only, when the desktop window is on the middle of the screen. When it
is in fullscreen mode, mouse touches physical edge of the screen, thus it's not
receiving events (actually it is, but mouse moves by 4 pixels only - seems that
it's the window border). So, the movement is slow, but still works.

X will not send events if mouse pointer moves outside the desktop.

So, my patch is almost done, but it needs one thing:

- X should send mouse events to WINE even if the pointer goes x = -112 (this
happens when the virtual desktop window is on the middle of the screen - -112
is relative to the virtual desktop window) - IMHO best solution
- Fullscreen apps should have bigger border - it won't be visible on fullscreen
apps, but will allow to receive mouse events. One disadvatange: won't work in
virtual desktop mode placed on the left side of the screen.

I've made a lot of testing yesterday, so I think this approach will be the best
one. Warping mouse all the time (especially to the middle of the window) will
break a lot of desktop apps.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list