win32: Fix composition UI being displayed when IME is disabled

This commit is contained in:
Cameron Gutman
2026-02-14 15:29:12 -06:00
committed by Sam Lantinga
parent ad60fa07d7
commit 8535936401

View File

@@ -1072,6 +1072,14 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD
*lParam &= element_mask;
return false;
} else if (msg == WM_IME_STARTCOMPOSITION) {
SDL_DebugIMELog("WM_IME_STARTCOMPOSITION");
if (videodata->ime_internal_composition) {
// Windows may still display a composition dialog even with
// ISC_SHOWUICOMPOSITIONWINDOW cleared, so trap the message
// here to prevent that (even when the IME is disabled).
return true;
}
}
if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) {
@@ -1099,12 +1107,6 @@ bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SD
SDL_DebugIMELog("WM_INPUTLANGCHANGE");
IME_InputLangChanged(videodata);
break;
case WM_IME_STARTCOMPOSITION:
SDL_DebugIMELog("WM_IME_STARTCOMPOSITION");
if (videodata->ime_internal_composition) {
trap = true;
}
break;
case WM_IME_COMPOSITION:
SDL_DebugIMELog("WM_IME_COMPOSITION %x", lParam);
if (videodata->ime_internal_composition) {