From 60717cde14cd7ddc2ca2904022ed10b323b5066c Mon Sep 17 00:00:00 2001 From: Raiden1411 <67233402+Raiden1411@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:03:44 +0000 Subject: [PATCH] chore: update fullscreen implementation --- src/apprt/gtk/App.zig | 11 +---------- src/apprt/gtk/Window.zig | 3 +++ src/config/Config.zig | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 72cf1a730..a23d8ed22 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -113,7 +113,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { break :app_id default_id; }, error.InvalidLength => { - log.warn("Class name value is over 255 chars in length. Setting app id to default value", .{}); + log.warn("Class name value doesn't have valid length (> 0 or 255 <=). Setting app id to default value", .{}); break :app_id default_id; }, error.NoDotInId => { @@ -325,15 +325,6 @@ 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 diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index b4a4327c9..28f3c9f6d 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -125,6 +125,9 @@ pub fn init(self: *Window, app: *App) !void { if (app.config.fullscreen) { c.gtk_window_fullscreen(self.window); + + // We disable this because we just want to start the first window in fullscreen. + app.config.fullscreen = false; } // All of our events diff --git a/src/config/Config.zig b/src/config/Config.zig index fb30d94bb..644f665a5 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -291,7 +291,7 @@ class: ?[:0]const u8 = null, /// The setting that will tell Ghostty which title to display. /// By default Ghostty will output the current directory or what application is running as the title, -/// but with this setting it will force Ghostty to output that title independent of what is happening in terminal. +/// but with this setting it will force Ghostty to output that title independent of what is happening in the terminal. title: ?[:0]const u8 = null, /// The directory to change to after starting the command.