瀏覽代碼

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 <[email protected]>
TechnicalSoup 3 年之前
父節點
當前提交
20fb34927d
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      platform/windows/display_server_windows.cpp

+ 9 - 0
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;
 }