chore: rename window-position-{x,y} to window-initial-position-{x,y}

This commit is contained in:
Adam Wolf
2024-12-31 10:35:23 -06:00
committed by Mitchell Hashimoto
parent 16bf3b8820
commit f9250e28b5
4 changed files with 8 additions and 8 deletions

View File

@ -370,7 +370,7 @@ class TerminalController: BaseTerminalController {
// Set our window positioning to coordinates if config value exists, otherwise // Set our window positioning to coordinates if config value exists, otherwise
// fallback to original centering behavior // fallback to original centering behavior
setInitialWindowPosition(window, x: config.windowPositionX, y: config.windowPositionY, windowDecorations: config.windowDecorations) setInitialWindowPosition(window, x: config.windowInitialPositionX, y: config.windowInitialPositionY, windowDecorations: config.windowDecorations)
// Make sure our theme is set on the window so styling is correct. // Make sure our theme is set on the window so styling is correct.
if let windowTheme = config.windowTheme { if let windowTheme = config.windowTheme {

View File

@ -150,17 +150,17 @@ extension Ghostty {
return String(cString: ptr) return String(cString: ptr)
} }
var windowPositionX: Int16? { var windowInitialPositionX: Int16? {
guard let config = self.config else { return nil } guard let config = self.config else { return nil }
var v: Int16 = 0 var v: Int16 = 0
let key = "window-position-x" let key = "window-initial-position-x"
return ghostty_config_get(config, &v, key, UInt(key.count)) ? v : nil return ghostty_config_get(config, &v, key, UInt(key.count)) ? v : nil
} }
var windowPositionY: Int16? { var windowInitialPositionY: Int16? {
guard let config = self.config else { return nil } guard let config = self.config else { return nil }
var v: Int16 = 0 var v: Int16 = 0
let key = "window-position-y" let key = "window-initial-position-y"
return ghostty_config_get(config, &v, key, UInt(key.count)) ? v : nil return ghostty_config_get(config, &v, key, UInt(key.count)) ? v : nil
} }

View File

@ -155,7 +155,7 @@ pub const App = struct {
.surface => |v| v, .surface => |v| v,
}); });
try surface.setInitialWindowPosition(self.config.@"window-position-x", self.config.@"window-position-y"); try surface.setInitialWindowPosition(self.config.@"window-initial-position-x", self.config.@"window-initial-position-y");
}, },
.new_tab => try self.newTab(switch (target) { .new_tab => try self.newTab(switch (target) {

View File

@ -1119,8 +1119,8 @@ keybind: Keybinds = .{},
/// ///
/// Important note: Setting this value will only work on macOS and glfw builds /// 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. /// on Linux. GTK 4.0 does not support setting the window position.
@"window-position-x": ?i16 = null, @"window-initial-position-x": ?i16 = null,
@"window-position-y": ?i16 = null, @"window-initial-position-y": ?i16 = null,
/// 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