From 1b149b744020294a32af790a70d1c3163f806ede Mon Sep 17 00:00:00 2001 From: Zae Date: Thu, 8 Jun 2023 02:40:36 +0800 Subject: [PATCH] Fix IME doesn't work under Popup on Windows. --- platform/windows/display_server_windows.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index f971846959e..b51b8c5babb 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -835,9 +835,12 @@ void DisplayServerWindows::show_window(WindowID p_id) { SetFocus(wd.hWnd); // Set keyboard focus. } else if (wd.minimized) { ShowWindow(wd.hWnd, SW_SHOWMINIMIZED); - } else if (wd.no_focus || wd.is_popup) { + } else if (wd.no_focus) { // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow ShowWindow(wd.hWnd, SW_SHOWNA); + } else if (wd.is_popup) { + ShowWindow(wd.hWnd, SW_SHOWNA); + SetFocus(wd.hWnd); // Set keyboard focus. } else { ShowWindow(wd.hWnd, SW_SHOW); SetForegroundWindow(wd.hWnd); // Slightly higher priority.