macos: handle setting initial window position when window is created

This commit is contained in:
Adam Wolf
2024-12-31 00:50:07 -06:00
committed by Mitchell Hashimoto
parent 970e45559b
commit 200d0d642b
4 changed files with 48 additions and 27 deletions

View File

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