SDL: gdk: Ignore focus loss events caused by text input showing the OSK (67f79)

From 67f796ebdee3dc3042535e9b523f2b0141dedbc4 Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Wed, 4 Jun 2025 09:40:33 -0400
Subject: [PATCH] gdk: Ignore focus loss events caused by text input showing
 the OSK

---
 src/core/gdk/SDL_gdk.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp
index 738daa5b78312..4e792ef270d89 100644
--- a/src/core/gdk/SDL_gdk.cpp
+++ b/src/core/gdk/SDL_gdk.cpp
@@ -105,7 +105,7 @@ bool GDK_RegisterChangeNotifications(void)
         SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler");
         SDL_VideoDevice *_this = SDL_GetVideoDevice();
         if (_this) {
-            if (constrained) {
+            if (constrained && !((_this->windows) && _this->windows->text_input_active)) {
                 SDL_SetKeyboardFocus(NULL);
             } else {
                 SDL_SetKeyboardFocus(_this->windows);