From fbdfed84bec30ce5cef28eff6fa16f9aac2774b9 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Sat, 9 Jul 2022 01:21:42 +0400 Subject: [PATCH] engine: platform: sdl: fixed bug with unhidable mouse cursor in center of screen --- engine/platform/sdl/in_sdl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engine/platform/sdl/in_sdl.c b/engine/platform/sdl/in_sdl.c index 129759bb..7f18c8ab 100644 --- a/engine/platform/sdl/in_sdl.c +++ b/engine/platform/sdl/in_sdl.c @@ -333,32 +333,33 @@ void Platform_SetCursorType( VGUI_DefaultCursor type ) break; } + host.mouse_visible = visible; + if( CVAR_TO_BOOL( touch_emulate )) return; #if SDL_VERSION_ATLEAST( 2, 0, 0 ) - if( visible && !host.mouse_visible ) + if( host.mouse_visible ) { SDL_SetCursor( cursors.cursors[type] ); SDL_ShowCursor( true ); Key_EnableTextInput( true, false ); } - else if( !visible && host.mouse_visible ) + else { SDL_ShowCursor( false ); Key_EnableTextInput( false, false ); } #else - if( visible && !host.mouse_visible ) + if( host.mouse_visible ) { SDL_ShowCursor( true ); } - else if( !visible && host.mouse_visible ) + else { SDL_ShowCursor( false ); } #endif - host.mouse_visible = visible; } /*