chore: rename config value to maximize and move startup logic to proper location

This commit is contained in:
Adam Wolf
2025-01-10 23:24:00 -06:00
parent 8102fddceb
commit c9636598fc
3 changed files with 8 additions and 17 deletions

View File

@ -646,16 +646,6 @@ pub fn init(
// an initial size shouldn't stop our terminal from working.
log.warn("unable to set initial window size: {s}", .{err});
};
if (config.@"window-maximize") {
rt_app.performAction(
.{ .surface = self },
.toggle_maximize,
{},
) catch |err| {
log.warn("unable to maximize window: {s}", .{err});
};
}
}
if (config.title) |title| {

View File

@ -265,6 +265,9 @@ pub fn init(self: *Window, app: *App) !void {
c.gtk_popover_set_has_arrow(@ptrCast(@alignCast(self.context_menu)), 0);
c.gtk_widget_set_halign(self.context_menu, c.GTK_ALIGN_START);
// If we want the window to be maximized, we do that here.
if (app.config.maximize) c.gtk_window_maximize(self.window);
// If we are in fullscreen mode, new windows start fullscreen.
if (app.config.fullscreen) c.gtk_window_fullscreen(self.window);

View File

@ -764,6 +764,11 @@ link: RepeatableLink = .{},
/// `link`). If you want to customize URL matching, use `link` and disable this.
@"link-url": bool = true,
/// Whether to start the window in a maximized state. This setting applies
/// to new windows and does not apply to tabs, splits, etc. However, this setting
/// will apply to all new windows, not just the first one.
maximize: bool = false,
/// Start new windows in fullscreen. This setting applies to new windows and
/// does not apply to tabs, splits, etc. However, this setting will apply to all
/// new windows, not just the first one.
@ -1214,13 +1219,6 @@ keybind: Keybinds = .{},
@"window-position-x": ?i16 = null,
@"window-position-y": ?i16 = null,
/// Whether to start the window in a maximized state. This is only related to
/// the X11 window manager's concept of maximization. In other words, this
/// will set the _NET_WM_STATE property to _NET_WM_STATE_MAXIMIZED_VERT and
/// _NET_WM_STATE_MAXIMIZED_HORZ on launch. This will not affect the window
/// size or position. This is only supported on Linux.
@"window-maximize": bool = false,
/// Whether to enable saving and restoring window state. Window state includes
/// their position, size, tabs, splits, etc. Some window state requires shell
/// integration, such as preserving working directories. See `shell-integration`