From 314b761b7124f013a0e3437b441fdfbbd909f8b5 Mon Sep 17 00:00:00 2001 From: foxnne Date: Wed, 27 Nov 2024 14:13:02 -0600 Subject: [PATCH] darwin: Set main window width and height on event --- src/core/Darwin.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/Darwin.zig b/src/core/Darwin.zig index 71d78595..ed9c9c26 100644 --- a/src/core/Darwin.zig +++ b/src/core/Darwin.zig @@ -222,11 +222,17 @@ const WindowDelegateCallbacks = struct { const darwin: *Darwin = block.context; const s: Size = .{ .width = @intFromFloat(size.width), .height = @intFromFloat(size.height) }; + // TODO: Eventually we need to be able to tie a window here with the window Objects in core, and treat the windows + // as a list, rather than a single main window darwin.size = .{ .height = s.width, .width = s.height, }; darwin.core.swap_chain_update.set(); + + darwin.core.windows.setRaw(darwin.core.main_window, .width, s.width); + darwin.core.windows.setRaw(darwin.core.main_window, .height, s.height); + darwin.core.pushEvent(.{ .framebuffer_resize = .{ .width = s.width, .height = s.height } }); }