From 4937ab142db4923abad3af1b78316320ed420eea Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Thu, 23 Jan 2025 14:33:34 +0100 Subject: [PATCH] Make com_activeApp work on Linux --- neo/sys/sdl/sdl_events.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/neo/sys/sdl/sdl_events.cpp b/neo/sys/sdl/sdl_events.cpp index b8d7ab65..1de6c359 100644 --- a/neo/sys/sdl/sdl_events.cpp +++ b/neo/sys/sdl/sdl_events.cpp @@ -452,6 +452,7 @@ sysEvent_t Sys_GetEvent() // DG: un-pause the game when focus is gained, that also re-grabs the input // disabling the cursor is now done once in GLimp_Init() because it should always be disabled cvarSystem->SetCVarBool( "com_pause", false ); + cvarSystem->SetCVarBool( "com_activeApp", true ); // DG end break; } @@ -459,6 +460,7 @@ sysEvent_t Sys_GetEvent() case SDL_WINDOWEVENT_FOCUS_LOST: // DG: pause the game when focus is lost, that also un-grabs the input cvarSystem->SetCVarBool( "com_pause", true ); + cvarSystem->SetCVarBool( "com_activeApp", false ); // DG end break; @@ -699,6 +701,9 @@ sysEvent_t Sys_GetEvent() case SDL_JOYBUTTONUP: case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: + + case SDL_CONTROLLERDEVICEADDED: + case SDL_CONTROLLERDEVICEREMOVED: // Avoid 'unknown event' spam continue; @@ -756,7 +761,10 @@ sysEvent_t Sys_GetEvent() } continue; // just handle next event + // Avoid 'unknown event' spam + case SDL_TEXTEDITING: case SDL_KEYMAPCHANGED: + case SDL_CLIPBOARDUPDATE: continue; // just handle next event default: