From a612e7f7ccd2d8fb935aaecf75e4d98eb4cb0d78 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Mon, 24 Jan 2022 16:31:35 +0100 Subject: [PATCH] sdl_gl_ctx: fix focus detection on webOS (#13526) --- config.def.h | 2 +- gfx/drivers_context/sdl_gl_ctx.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index b9a53c3a4e..71d392d4be 100644 --- a/config.def.h +++ b/config.def.h @@ -1144,7 +1144,7 @@ static const bool audio_enable_menu_bgm = false; #define DEFAULT_REWIND_GRANULARITY 1 #endif /* Pause gameplay when gameplay loses focus. */ -#if defined(EMSCRIPTEN) || defined(WEBOS) +#if defined(EMSCRIPTEN) #define DEFAULT_PAUSE_NONACTIVE false #else #define DEFAULT_PAUSE_NONACTIVE true diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 4c29fcb41a..13ce59355d 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -377,7 +377,12 @@ static bool sdl_ctx_has_focus(void *data) #ifdef HAVE_SDL2 gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data; +#ifdef WEBOS + // We do not receive mouse focus when non-magic remote is used. + flags = (SDL_WINDOW_INPUT_FOCUS); +#else flags = (SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_MOUSE_FOCUS); +#endif return (SDL_GetWindowFlags(sdl->win) & flags) == flags; #else flags = (SDL_APPINPUTFOCUS | SDL_APPACTIVE);