chore: rename config value to maximize and move startup logic to proper location
parent
8102fddceb
commit
c9636598fc
|
|
@ -646,16 +646,6 @@ pub fn init(
|
||||||
// an initial size shouldn't stop our terminal from working.
|
// an initial size shouldn't stop our terminal from working.
|
||||||
log.warn("unable to set initial window size: {s}", .{err});
|
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| {
|
if (config.title) |title| {
|
||||||
|
|
|
||||||
|
|
@ -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_popover_set_has_arrow(@ptrCast(@alignCast(self.context_menu)), 0);
|
||||||
c.gtk_widget_set_halign(self.context_menu, c.GTK_ALIGN_START);
|
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 we are in fullscreen mode, new windows start fullscreen.
|
||||||
if (app.config.fullscreen) c.gtk_window_fullscreen(self.window);
|
if (app.config.fullscreen) c.gtk_window_fullscreen(self.window);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -764,6 +764,11 @@ link: RepeatableLink = .{},
|
||||||
/// `link`). If you want to customize URL matching, use `link` and disable this.
|
/// `link`). If you want to customize URL matching, use `link` and disable this.
|
||||||
@"link-url": bool = true,
|
@"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
|
/// 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
|
/// does not apply to tabs, splits, etc. However, this setting will apply to all
|
||||||
/// new windows, not just the first one.
|
/// new windows, not just the first one.
|
||||||
|
|
@ -1214,13 +1219,6 @@ keybind: Keybinds = .{},
|
||||||
@"window-position-x": ?i16 = null,
|
@"window-position-x": ?i16 = null,
|
||||||
@"window-position-y": ?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
|
/// Whether to enable saving and restoring window state. Window state includes
|
||||||
/// their position, size, tabs, splits, etc. Some window state requires shell
|
/// their position, size, tabs, splits, etc. Some window state requires shell
|
||||||
/// integration, such as preserving working directories. See `shell-integration`
|
/// integration, such as preserving working directories. See `shell-integration`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue