Repository navigation
Disable local Windows IME on the streaming window - #2108
Closed
hinatamaxxx wants to merge 1 commit into
Closed
hinatamaxxx wants to merge 1 commit into
hinatamaxxx wants to merge 1 commit into
Conversation
Member
|
This should be upstreamed to SDL3 rather than hacking around the issue here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows (especially with sdl2-compat / SDL3), Japanese IME typing during a stream can drop or repeat characters because the local Windows IME remains attached to the streaming window.
Root Cause
Session::initialize()callsSDL_StopTextInput()before creating the hidden decoder probe window (testWindow) and the actual streaming window (m_Window).In SDL3's Windows keyboard backend (
src/video/windows/SDL_windowskeyboard.c),IME_Init()latchesime_hwnd_mainonto the first created window (testWindow), andIME_Disable()only callsImmAssociateContext(..., 0)whenime_hwnd_current == ime_hwnd_main. As a result, subsequent windows (and windows recreated after fullscreen transitions or decoder initialization) retain an active localHIMCeven thoughSDL_IsTextInputActive()isfalse, allowing the client's local IME to intercept keystrokes meant for the host.Fix
WindowsKeyboardInput::disableLocalIme()) that detaches the local IME context directly from the streaming window'sHWNDviaImmAssociateContextEx(hwnd, nullptr, 0).SdlInputHandler::setWindow()), on focus gain (notifyFocusGained()), after fullscreen transitions (Session::toggleFullscreen(),Session::exec()), and after decoder initialization (chooseDecoder()), since those transitions can recreate the nativeHWND.imm32.libon Windows inapp/app.pro.This does not touch the Qt UI windows, does not enable Raw Input, and has no effect on non-Windows platforms.
Testing
Tested on Windows 11 client (Japanese JIS keyboard, Microsoft IME) streaming to a Windows 11 host (Sunshine):
Ctrl+Alt+Shift+F) andAlt+Tabfocus loss/gain: local IME stays detached and Japanese typing remains normal.Ctrl+C,Ctrl+V,Ctrl+A,Shift+Arrow): normal.