Skip to content

Commit

Permalink
Merge pull request #2573 from ghostty-org/push-vptzlskpyvys
Browse files Browse the repository at this point in the history
macos: restore window frame on cascadeTopLeft since macOS 15 moves it
  • Loading branch information
mitchellh authored Nov 2, 2024
2 parents 0ba3c67 + 9262cc5 commit d47df21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions macos/Sources/Features/Terminal/TerminalManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,19 @@ class TerminalManager {
// are closing a tabbed window, we want to set the cascade point to be
// the next cascade point from this window.
if focusedWindow != controller.window {
// The cascadeTopLeft call below should NOT move the window. Starting with
// macOS 15, we found that specifically when used with the new window snapping
// features of macOS 15, this WOULD move the frame. So we keep track of the
// old frame and restore it if necessary. Issue:
// https://github.com/ghostty-org/ghostty/issues/2565
let oldFrame = focusedWindow.frame

Self.lastCascadePoint = focusedWindow.cascadeTopLeft(from: NSZeroPoint)

if focusedWindow.frame != oldFrame {
focusedWindow.setFrame(oldFrame, display: true)
}

return
}

Expand Down

0 comments on commit d47df21

Please sign in to comment.