diff --git a/src/platform/native.zig b/src/platform/native.zig index f8a301b7..9f8b1225 100644 --- a/src/platform/native.zig +++ b/src/platform/native.zig @@ -406,6 +406,7 @@ pub const Platform = struct { const position = platform.last_position; try platform.window.setMonitor(null, @intCast(i32, position.x), @intCast(i32, position.y), options.width, options.height, null); } + if (options.headless) platform.window.hide() catch {}; } pub fn setShouldClose(platform: *Platform, value: bool) void { diff --git a/src/structs.zig b/src/structs.zig index 2cb11fbd..68b73ab0 100644 --- a/src/structs.zig +++ b/src/structs.zig @@ -34,6 +34,10 @@ pub const Options = struct { /// Fullscreen window. fullscreen: bool = false, + /// Headless mode. Once set, this cannot be unset (because e.g. Wayland does not support showing + /// a window after it was hidden.) + headless: bool = false, + /// Monitor synchronization modes. vsync: enums.VSyncMode = .double,