浏览代码

Merge pull request #80548 from garychia/keyboard_focus

Ensure the active window gains the keyboard focus
Rémi Verschelde 1 年之前
父节点
当前提交
92e9bcb633
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      platform/windows/display_server_windows.cpp

+ 4 - 0
platform/windows/display_server_windows.cpp

@@ -3452,6 +3452,10 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
 			}
 			}
 			if (wParam != WA_INACTIVE) {
 			if (wParam != WA_INACTIVE) {
 				track_mouse_leave_event(hWnd);
 				track_mouse_leave_event(hWnd);
+
+				if (!IsIconic(hWnd)) {
+					SetFocus(hWnd);
+				}
 			}
 			}
 			return 0; // Return to the message loop.
 			return 0; // Return to the message loop.
 		} break;
 		} break;