mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 16:11:23 +00:00
Stop grabbing mouse when game window doesn't have the focus
This commit is contained in:
parent
70cf707251
commit
f0ff273620
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…
Reference in a new issue