mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
fix: fullscreen on new windows
This commit is contained in:
@ -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.
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user