Explorar o código

Ensure the active window gains the keyboard focus

Chia-Hsiang Cheng %!s(int64=2) %!d(string=hai) anos
pai
achega
669ce39f95
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      platform/windows/display_server_windows.cpp

+ 4 - 0
platform/windows/display_server_windows.cpp

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