diff options
author | TechnicalSoup <ben.werbowyj@gmail.com> | 2022-02-07 12:28:42 +1100 |
---|---|---|
committer | TechnicalSoup <ben.werbowyj@gmail.com> | 2022-02-07 23:03:10 +1100 |
commit | 20fb34927d8a03c60c8fa9a3c58d0d582fd6aee9 (patch) | |
tree | 3f51e6a6badfa0c5b5e94b0a6a6cef715dd654d4 | |
parent | 8aa4ed8b5b22881661f1355cf90871c4e25c68e2 (diff) |
Fix icons for sub windows
Modify the create_sub_window method to set an icon for all sub windows, setting the icon to the same icon as the main window.
Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
-rw-r--r-- | platform/windows/display_server_windows.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index b340129a16..21ab9923a2 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -546,6 +546,15 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod wd.no_focus = true; } + // Inherit icons from MAIN_WINDOW for all sub windows. + HICON mainwindow_icon = (HICON)SendMessage(windows[MAIN_WINDOW_ID].hWnd, WM_GETICON, ICON_SMALL, 0); + if (mainwindow_icon) { + SendMessage(windows[window_id].hWnd, WM_SETICON, ICON_SMALL, (LPARAM)mainwindow_icon); + } + mainwindow_icon = (HICON)SendMessage(windows[MAIN_WINDOW_ID].hWnd, WM_GETICON, ICON_BIG, 0); + if (mainwindow_icon) { + SendMessage(windows[window_id].hWnd, WM_SETICON, ICON_BIG, (LPARAM)mainwindow_icon); + } return window_id; } |