From 8535936401edd9605af706db57158fe1c7199ae8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 14 Feb 2026 15:29:12 -0600 Subject: [PATCH] win32: Fix composition UI being displayed when IME is disabled --- src/video/windows/SDL_windowskeyboard.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 9129c7dd9e..ca15a1c1f8 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -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) {