Fix destroyed windows removing keyboard focus on macOS

This commit is contained in:
2026-04-04 18:36:51 +03:00
parent b99c8ddda7
commit 576130f74f

View File

@@ -294,8 +294,13 @@ SDLWindow::~SDLWindow()
if (Input::Mouse != nullptr && Input::Mouse->IsRelative(this))
Input::Mouse->SetRelativeMode(false, this);
SDL_StopTextInput(_window);
// The text input events seems to be controlled globally on macOS,
// calling this for closing window seems to remove keyboard focus from other windows...
#if !PLATFORM_MAC
if (_settings.AllowInput && SDL_TextInputActive(_window))
SDL_StopTextInput(_window);
#endif
SDL_DestroyWindow(_window);
_window = nullptr;