Browse Source

engine: sdl: fix mouse activated when focus gained but not game is active

pull/2/head
Alibek Omarov 3 years ago
parent
commit
89baa633c8
  1. 12
      engine/platform/sdl/events.c

12
engine/platform/sdl/events.c

@ -340,7 +340,11 @@ static void SDLash_ActiveEvent( int gain )
if( gain ) if( gain )
{ {
host.status = HOST_FRAME; host.status = HOST_FRAME;
IN_ActivateMouse( ); if( cls.key_dest == key_game )
{
IN_ActivateMouse( );
}
if( dma.initialized && snd_mute_losefocus.value ) if( dma.initialized && snd_mute_losefocus.value )
{ {
SNDDMA_Activate( true ); SNDDMA_Activate( true );
@ -360,7 +364,11 @@ static void SDLash_ActiveEvent( int gain )
} }
#endif #endif
host.status = HOST_NOFOCUS; host.status = HOST_NOFOCUS;
IN_DeactivateMouse(); if( cls.key_dest == key_game )
{
IN_DeactivateMouse();
}
if( dma.initialized && snd_mute_losefocus.value ) if( dma.initialized && snd_mute_losefocus.value )
{ {
SNDDMA_Activate( false ); SNDDMA_Activate( false );

Loading…
Cancel
Save