diff --git a/src/Surface.zig b/src/Surface.zig index 5396c2068..60f29ccc6 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -155,6 +155,7 @@ const DerivedConfig = struct { window_padding_y: u32, window_padding_balance: bool, title: ?[:0]const u8, + fullscreen: bool, pub fn init(alloc_gpa: Allocator, config: *const configpkg.Config) !DerivedConfig { var arena = ArenaAllocator.init(alloc_gpa); @@ -180,6 +181,7 @@ const DerivedConfig = struct { .window_padding_y = config.@"window-padding-y", .window_padding_balance = config.@"window-padding-balance", .title = config.title, + .fullscreen = config.fullscreen, // Assignments happen sequentially so we have to do this last // so that the memory is captured from allocs above. diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 7c830aef9..72cf1a730 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -325,6 +325,15 @@ pub fn redrawInspector(self: *App, surface: *Surface) void { pub fn newWindow(self: *App, parent_: ?*CoreSurface) !void { const alloc = self.core_app.alloc; + // If we are in fullscreen mode and have a parent surface we force the disable of this setting. + // This prevents that new windows get created in fullscreen mode. + // This also prevents that the settings always gets set to false everytime a new window is created. + if (self.config.fullscreen) { + if (parent_) |_| { + self.config.fullscreen = false; + } + } + // Allocate a fixed pointer for our window. We try to minimize // allocations but windows and other GUI requirements are so minimal // compared to the steady-state terminal operation so we use heap