Backends: SDL2: Fixed build for Emscripten and SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE=0 platforms.

Amend e06b5df.
This commit is contained in:
ocornut
2025-09-24 15:29:00 +02:00
parent 719ea9c228
commit 940627d008

View File

@@ -667,6 +667,7 @@ static void ImGui_ImplSDL2_UpdateMouseData()
SDL_Window* focused_window = SDL_GetKeyboardFocus();
const bool is_app_focused = (bd->Window == focused_window);
#else
SDL_Window* focused_window = bd->Window;
const bool is_app_focused = (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_INPUT_FOCUS) != 0; // SDL 2.0.3 and non-windowed systems: single-viewport only
#endif
if (is_app_focused)