sdl_gl_ctx: fix focus detection on webOS (#13526)

This commit is contained in:
Piotr Dobrowolski 2022-01-24 16:31:35 +01:00 committed by GitHub
parent 6ae1270e5c
commit a612e7f7cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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);