diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 1525985d..d934b3de 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -632,6 +632,12 @@ bool Session::initialize(QQuickWindow* qtWindow) return false; } + // Stop text input. SDL enables it by default + // when we initialize the video subsystem, but this + // causes an IME popup when certain keys are held down + // on macOS. + SDL_StopTextInput(); + LiInitializeStreamConfiguration(&m_StreamConfig); m_StreamConfig.width = m_Preferences->width; m_StreamConfig.height = m_Preferences->height; @@ -1907,12 +1913,6 @@ void Session::exec() } } - // Stop text input. SDL enables it by default - // when we initialize the video subsystem, but this - // causes an IME popup when certain keys are held down - // on macOS. - SDL_StopTextInput(); - // Disable the screen saver if requested if (m_Preferences->keepAwake) { SDL_DisableScreenSaver(); diff --git a/app/streaming/streamutils.cpp b/app/streaming/streamutils.cpp index dde5f704..b5372e34 100644 --- a/app/streaming/streamutils.cpp +++ b/app/streaming/streamutils.cpp @@ -89,6 +89,11 @@ SDL_Window* StreamUtils::createTestWindow() SDL_Window* testWindow; Uint32 baseFlags = 0; + // Stop text input before creating the test window to avoid sdl2-compat + // starting text input on the new window. This might trigger the IME to + // be displayed. + SDL_StopTextInput(); + // Test windows are always hidden baseFlags |= SDL_WINDOW_HIDDEN;