Browse Source

Merge pull request #77977 from zaevi/fix_windows_popup_ime

Fix IME doesn't work under Popup on Windows.
Rémi Verschelde 2 years ago
parent
commit
759309ba18
1 changed files with 4 additions and 1 deletions
  1. 4 1
      platform/windows/display_server_windows.cpp

+ 4 - 1
platform/windows/display_server_windows.cpp

@@ -835,9 +835,12 @@ void DisplayServerWindows::show_window(WindowID p_id) {
 		SetFocus(wd.hWnd); // Set keyboard focus.
 		SetFocus(wd.hWnd); // Set keyboard focus.
 	} else if (wd.minimized) {
 	} else if (wd.minimized) {
 		ShowWindow(wd.hWnd, SW_SHOWMINIMIZED);
 		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
 		// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
 		ShowWindow(wd.hWnd, SW_SHOWNA);
 		ShowWindow(wd.hWnd, SW_SHOWNA);
+	} else if (wd.is_popup) {
+		ShowWindow(wd.hWnd, SW_SHOWNA);
+		SetFocus(wd.hWnd); // Set keyboard focus.
 	} else {
 	} else {
 		ShowWindow(wd.hWnd, SW_SHOW);
 		ShowWindow(wd.hWnd, SW_SHOW);
 		SetForegroundWindow(wd.hWnd); // Slightly higher priority.
 		SetForegroundWindow(wd.hWnd); // Slightly higher priority.