- changed the place where the CheckRequireMouse event gets called.

The original place in I_CheckNativeMouse is unsafe because that function can get called from the system message queue which can result in a bad global state of the VM for such a call because it can be recursively invoked from code that may temporarily alter some settings.
This commit is contained in:
Christoph Oelckers 2019-02-02 11:00:26 +01:00
commit d005e0b483
3 changed files with 10 additions and 6 deletions

View file

@ -284,7 +284,7 @@ static bool CaptureMode_InGame()
//
//==========================================================================
void I_CheckNativeMouse(bool preferNative)
void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult)
{
bool windowed = (screen == NULL) || !screen->IsFullscreen();
bool want_native;
@ -311,7 +311,7 @@ void I_CheckNativeMouse(bool preferNative)
}
}
if (!want_native && eventManager.CheckRequireMouse())
if (!want_native && eventhandlerresult)
want_native = true;
//Printf ("%d %d %d\n", wantNative, preferNative, NativeMouse);