mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
chore: update fullscreen implementation
This commit is contained in:
@ -113,7 +113,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App {
|
|||||||
break :app_id default_id;
|
break :app_id default_id;
|
||||||
},
|
},
|
||||||
error.InvalidLength => {
|
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;
|
break :app_id default_id;
|
||||||
},
|
},
|
||||||
error.NoDotInId => {
|
error.NoDotInId => {
|
||||||
@ -325,15 +325,6 @@ pub fn redrawInspector(self: *App, surface: *Surface) void {
|
|||||||
pub fn newWindow(self: *App, parent_: ?*CoreSurface) !void {
|
pub fn newWindow(self: *App, parent_: ?*CoreSurface) !void {
|
||||||
const alloc = self.core_app.alloc;
|
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
|
// Allocate a fixed pointer for our window. We try to minimize
|
||||||
// allocations but windows and other GUI requirements are so minimal
|
// allocations but windows and other GUI requirements are so minimal
|
||||||
// compared to the steady-state terminal operation so we use heap
|
// compared to the steady-state terminal operation so we use heap
|
||||||
|
@ -125,6 +125,9 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
|
|
||||||
if (app.config.fullscreen) {
|
if (app.config.fullscreen) {
|
||||||
c.gtk_window_fullscreen(self.window);
|
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
|
// All of our events
|
||||||
|
@ -291,7 +291,7 @@ class: ?[:0]const u8 = null,
|
|||||||
|
|
||||||
/// The setting that will tell Ghostty which title to display.
|
/// 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,
|
/// 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,
|
title: ?[:0]const u8 = null,
|
||||||
|
|
||||||
/// The directory to change to after starting the command.
|
/// The directory to change to after starting the command.
|
||||||
|
Reference in New Issue
Block a user