Skip to content

Commit

Permalink
Fix icons for sub windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
TechnicalSoup and akien-mga committed Feb 7, 2022
1 parent 8aa4ed8 commit 20fb349
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 20fb349

Please sign in to comment.