win32 gui: unbreak window icon

woops, accidently broke the window icon by moving the code that loads
it after calling RegisterClass, here's the fix
This commit is contained in:
Jonathan Marler 2025-01-06 08:48:47 -07:00 committed by CJ van den Berg
parent 95d07ab1a5
commit c7d6bd6805

View file

@ -396,6 +396,9 @@ fn entry(pid: thespian.pid) !void {
const CLASS_NAME = win32.L("Flow");
const initial_placement = calcWindowPlacement();
global.icons = getIcons(initial_placement.dpi);
// we only need to register the window class once per process
if (global.window_class == 0) {
const wc = win32.WNDCLASSEXW{
@ -419,9 +422,6 @@ fn entry(pid: thespian.pid) !void {
);
}
const initial_placement = calcWindowPlacement();
global.icons = getIcons(initial_placement.dpi);
var create_args = CreateWindowArgs{
.allocator = arena_instance.allocator(),
.pid = pid,