mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-22 20:11:40 +00:00
Fix in_nograb not releasing the mouse cursor
Disable SDL relative mouse mode when in_nograb is enabled. Relative mouse mode hides the cursor and it cannot exit the window regardless of the window's grab state. This wasn't always the case. SDL before 2.0.4 on GNU/Linux released the mouse cursor in relative mode. However, SDL 2.0.3/4 on Windows does not. (I did not test other Windows versions.) So I think SDL 2.0.4 made GNU/Linux X11 behavior consistent with other platforms. This fixes mouse input being unusable when debuging client crashes in gdb.
This commit is contained in:
parent
a48dcdf224
commit
098d97bdb0
1 changed files with 5 additions and 2 deletions
|
@ -360,10 +360,13 @@ static void IN_ActivateMouse( void )
|
|||
{
|
||||
if( in_nograb->modified || !mouseActive )
|
||||
{
|
||||
if( in_nograb->integer )
|
||||
if( in_nograb->integer ) {
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
SDL_SetWindowGrab( SDL_window, SDL_FALSE );
|
||||
else
|
||||
} else {
|
||||
SDL_SetRelativeMouseMode( SDL_TRUE );
|
||||
SDL_SetWindowGrab( SDL_window, SDL_TRUE );
|
||||
}
|
||||
|
||||
in_nograb->modified = qfalse;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue