[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
Fri Jun 19 12:46:57 CDT 2009


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


Vitaliy Margolen <vitaliy at kievinfo.com> changed:

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

Paul "TBBle" Hampson <Paul.Hampson at Pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Paul.Hampson at Pobox.com

Christoph Korn <c_korn at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |c_korn at gmx.de

chaykin <rchayster at gmail.com> changed:

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

Adrian Lüthi <adi.l at bluewin.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adi.l at bluewin.ch

dlzerocool <dl.zerocool at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dl.zerocool at gmail.com

Stephane Mikaty <stephane at mikaty.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stephane at mikaty.net

Casey Jones <pvtpuddin at gmail.com> changed:

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

Dennis Schridde <lindevel at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lindevel at gmx.net

Lars Blomqvist <knaprigt at gmail.com> changed:

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

giovanni.nicola at ticino.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovanni.nicola at ticino.com

Vitaliy Margolen <vitaliy at kievinfo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hoehle at users.sourceforge.ne
                   |                            |t

Alessandro Pedarra <alessandro.pedarra at inbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alessandro.pedarra at inbox.co
                   |                            |m

sheen <toxmerguez at yahoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |toxmerguez at yahoo.fr




--- Comment #234 from Vitaliy Margolen <vitaliy at kievinfo.com>  2009-03-20 10:45:03 ---
*** Bug 17801 has been marked as a duplicate of this bug. ***

--- Comment #235 from Paul "TBBle" Hampson <Paul.Hampson at Pobox.com>  2009-03-22 10:05:43 ---
XInput2 is starting to firm up
(http://lists.x.org/archives/xorg-devel/2009-March/000514.html via Phoronix) so
it might be a good time to investigate a preliminary XInput2-based solution to
this bug, and ensure that the XInput2 API is sufficient (while it's still
malleable enough to fix) to cover the requirements.

As I understand it, the issue here is that when dinput is being used to capture
the mouse exclusively (ie. using DirectInput's Acquire with DISCL_EXCLUSIVE and
hence DISCL_FOREGROUND) no other X events should be sent for that mouse, and
the cursor's position should no longer affect anything that happens (ie the
cursor becomes uninteresting and invisible, and all mouse events are sent back
via directinput) which includes not changing focus to other windows, and this
state needs to be cleared when focus is lost.

If DISCL_NONEXCLUSIVE is used, then the application needs to be able to start
reading events from the mouse either at any time (DISCL_BACKGROUND) or only
when it has focus (DISCL_FOREGROUND) but in this case the cursor remains tied
to the mouse (unless something else has it acquired with DISCL_EXCLUSIVE) and
free to move about the screen.

I'm not sure from reading this bug if it also covers programs that capture the
mouse using ClipCursor, I take it from comment 67 that XGrabPointer is already
used to cover this method, as programs using this do not expect to receive
movement events from the cursor that would take it outside the clip rectangle.

On initial consideration, it seems to me that this interface should be exported
from winex11.drv (and alternative display/input drivers) for use by dinput.dll.

http://msdn.microsoft.com/en-us/library/bb147211(VS.85).aspx (briefly)
documents a sample program in the DirectX SDK which exercises the various modes
of using the mouse under DirectInput.

--- Comment #236 from Paul "TBBle" Hampson <Paul.Hampson at Pobox.com>  2009-03-22 11:26:38 ---
(In reply to comment #235)
> I'm not sure from reading this bug if it also covers programs that capture the
> mouse using ClipCursor, I take it from comment 67 that XGrabPointer is already
> used to cover this method, as programs using this do not expect to receive
> movement events from the cursor that would take it outside the clip rectangle.

On looking at the actual code, this is not how ClipCursor currently works.
Currently, it just keeps track of the rectangle requested, and if we receive a
mouse move event that would take us outside that window, we reset our cusor
position (but not the X mouse position or the position reported in the
WM_MOUSEMOVE event). This seems to me to have three problems. We don't actually
lock the mouse within the requested rectangle, if we don't see the mouse event
we can't even clip the cursor (but in that case the cursor wouldn't move
anyway) and we report a possibly-unexpected position (outside the clip) in
WM_MOUSEMOUSE, which doesn't match our cursor position.

I'm not sure that last one is actually incorrect -- from the ClipCursor MSDN
page and my recollections of its behaviour, other applications can override
your ClipCursor at any time, and do not have to be in the foreground to do so.
MSDN says they musn't, though... So in theory any application which relies on
being able to do so is incorrect, but conversely no application can rely on its
mouse input actually being limited to where its ClipCursor is set.

The problem with using XGrabPointer for this (which is what attachment 11735
from comment 82 appears to be doing) is that (as far as I understand from the
manpage, I haven't tried this) it also affects what windows actually receive
X11 events, which isn't actually true of ClipCursor, although it will produce
the correct results for the general use-case of a Win32 program calling
ClipCusor with its own window rectangle or client-area rectangle.

Anyway, if ClipCursor does have any issues, it probably should be addressed in
a seperate bug, or this bug just gets too conflated.

--- Comment #237 from Peter Kovacs <legine at gmx.net>  2009-03-26 16:20:23 ---


More information about the wine-bugs mailing list