Stop grabbing mouse when game window doesn't have the focus
This commit is contained in:
parent
8e6b54172f
commit
a8acdb9d37
1 changed files with 5 additions and 1 deletions
|
|
@ -267,7 +267,7 @@ void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((GetForegroundWindow() != mainwindow.GetHandle()) || preferNative || !use_mouse)
|
||||
if (preferNative || !use_mouse)
|
||||
{
|
||||
want_native = true;
|
||||
}
|
||||
|
|
@ -286,6 +286,10 @@ void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult)
|
|||
if (!want_native && eventhandlerresult)
|
||||
want_native = true;
|
||||
|
||||
// The application should *never* grab the mouse cursor if its window doesn't have the focus.
|
||||
if (GetForegroundWindow() != mainwindow.GetHandle())
|
||||
want_native = true;
|
||||
|
||||
//Printf ("%d %d %d\n", wantNative, preferNative, NativeMouse);
|
||||
|
||||
if (want_native != NativeMouse)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue