mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-05 01:16:33 +00:00
macos: handle setting initial window position when window is created
This commit is contained in:

committed by
Mitchell Hashimoto

parent
970e45559b
commit
200d0d642b
@@ -517,9 +517,6 @@ extension Ghostty {
|
||||
case GHOSTTY_ACTION_INITIAL_SIZE:
|
||||
setInitialSize(app, target: target, v: action.action.initial_size)
|
||||
|
||||
case GHOSTTY_ACTION_INITIAL_POSITION:
|
||||
setInitialPosition(app, target: target, v: action.action.initial_position)
|
||||
|
||||
case GHOSTTY_ACTION_CELL_SIZE:
|
||||
setCellSize(app, target: target, v: action.action.cell_size)
|
||||
|
||||
@@ -1072,26 +1069,6 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
private static func setInitialPosition(
|
||||
_ app: ghostty_app_t,
|
||||
target: ghostty_target_s,
|
||||
v: ghostty_action_initial_position_s) {
|
||||
switch (target.tag) {
|
||||
case GHOSTTY_TARGET_APP:
|
||||
Ghostty.logger.warning("mouse over link does nothing with an app target")
|
||||
return
|
||||
|
||||
case GHOSTTY_TARGET_SURFACE:
|
||||
guard let surface = target.target.surface else { return }
|
||||
guard let surfaceView = self.surfaceView(from: surface) else { return }
|
||||
surfaceView.initialPosition = NSMakePoint(Double(v.x), Double(v.y))
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
}
|
||||
|
||||
private static func setCellSize(
|
||||
_ app: ghostty_app_t,
|
||||
target: ghostty_target_s,
|
||||
|
Reference in New Issue
Block a user