From cba1fd7cca0a591ab53232135ef2b5b6729e9f1b Mon Sep 17 00:00:00 2001 From: Patrick Dawson Date: Thu, 2 Feb 2023 21:41:36 +0100 Subject: DisplayServerWindows: Update `last_focused_window` when the focused subwindow is deleted --- platform/windows/display_server_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/windows') diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 777d05584c..fd4f8ea7e3 100644 --- a/platform/windows/display_server_windows.cpp +++ b/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) { -- cgit v1.2.3