tweaks to window position

This commit is contained in:
Mitchell Hashimoto
2025-01-02 13:04:30 -08:00
parent f49a029c49
commit 29b96be84f
4 changed files with 61 additions and 46 deletions

View File

@@ -1108,7 +1108,7 @@ keybind: Keybinds = .{},
@"window-height": u32 = 0,
@"window-width": u32 = 0,
/// The initial window position. This position is in pixels and is relative
/// The starting window position. This position is in pixels and is relative
/// to the top-left corner of the primary monitor. Both values must be set to take
/// effect. If only one value is set, it is ignored.
///
@@ -1117,10 +1117,22 @@ keybind: Keybinds = .{},
/// to be a certain position to fit within the grid. There is nothing Ghostty
/// will do about this, but it will make an effort.
///
/// Important note: Setting this value will only work on macOS and glfw builds
/// on Linux. GTK 4.0 does not support setting the window position.
@"window-initial-position-x": ?i16 = null,
@"window-initial-position-y": ?i16 = null,
/// Also note that negative values are also up to the operating system and
/// window manager. Some window managers may not allow windows to be placed
/// off-screen.
///
/// Invalid positions are runtime-specific, but generally the positions are
/// clamped to the nearest valid position.
///
/// On macOS, the window position is relative to the top-left corner of
/// the visible screen area. This means that if the menu bar is visible, the
/// window will be placed below the menu bar.
///
/// Note: this is only supported on macOS and Linux GLFW builds. The GTK
/// runtime does not support setting the window position (this is a limitation
/// of GTK 4.0).
@"window-position-x": ?i16 = null,
@"window-position-y": ?i16 = null,
/// Whether to enable saving and restoring window state. Window state includes
/// their position, size, tabs, splits, etc. Some window state requires shell