Browse Source

Merge pull request #72624 from pkdawson/fix-last-focus

DisplayServerWindows: Update `last_focused_window` when the focused subwindow is deleted
Rémi Verschelde 2 years ago
parent
commit
d8c3fc1f56
1 changed files with 4 additions and 0 deletions
  1. 4 0
      platform/windows/display_server_windows.cpp

+ 4 - 0
platform/windows/display_server_windows.cpp

@@ -829,6 +829,10 @@ void DisplayServerWindows::delete_sub_window(WindowID p_window) {
 	}
 	DestroyWindow(windows[p_window].hWnd);
 	windows.erase(p_window);
+
+	if (last_focused_window == p_window) {
+		last_focused_window = INVALID_WINDOW_ID;
+	}
 }
 
 void DisplayServerWindows::gl_window_make_current(DisplayServer::WindowID p_window_id) {