From 2e98d43a584a90d14172b631d519bad499ac8a75 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 7 Aug 2023 19:28:48 -0700 Subject: [PATCH] apprt/glfw: launch window on startup --- src/apprt/glfw.zig | 8 ++++++++ src/apprt/gtk.zig | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apprt/glfw.zig b/src/apprt/glfw.zig index c3cb6d683..1c2d3b2c1 100644 --- a/src/apprt/glfw.zig +++ b/src/apprt/glfw.zig @@ -65,6 +65,14 @@ pub const App = struct { // up when we take a pass at cleaning up the dev mode. if (DevMode.enabled) DevMode.instance.config = config; + // Queue a single new window that starts on launch + _ = core_app.mailbox.push(.{ + .new_window = .{}, + }, .{ .forever = {} }); + + // We want the event loop to wake up instantly so we can process our tick. + glfw.postEmptyEvent(); + return .{ .app = core_app, .config = config, diff --git a/src/apprt/gtk.zig b/src/apprt/gtk.zig index 64d48be5a..abb06842d 100644 --- a/src/apprt/gtk.zig +++ b/src/apprt/gtk.zig @@ -283,7 +283,7 @@ pub const App = struct { // Queue a new window _ = core_app.mailbox.push(.{ .new_window = .{}, - }, .{ .instant = {} }); + }, .{ .forever = {} }); } };