From 2104e0749c6da413b173bce375d77975fd41f4be Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:30:43 +0200 Subject: [PATCH] macOS: hide visible NSScrollPocket for hidden title bar Fixes https://github.com/ghostty-org/ghostty/issues/13390 --- .../Window Styles/HiddenTitlebarTerminalWindow.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/macos/Sources/Features/Terminal/Window Styles/HiddenTitlebarTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/HiddenTitlebarTerminalWindow.swift index 766ec5857..d907db958 100644 --- a/macos/Sources/Features/Terminal/Window Styles/HiddenTitlebarTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/HiddenTitlebarTerminalWindow.swift @@ -70,6 +70,18 @@ class HiddenTitlebarTerminalWindow: TerminalWindow { let titleBarContainer = themeFrame.firstDescendant(withClassName: "NSTitlebarContainerView") { titleBarContainer.isHidden = true } + + // It seems AppKit moves `NSScrollPocket` to the title bar on macOS 27. + // We should hide it to prevent it covering terminal contents. + // + // Linked issue: https://github.com/ghostty-org/ghostty/issues/13390 + // Reference: https://developer.apple.com/forums/thread/798392?answerId=856013022#856013022 + // Note: hiding `NSTitlebarBackgroundView` won't work here, because it later uses the pocket view from the `SurfaceScrollView`. + if #available(macOS 27, *), + let themeFrame = contentView?.superview, + let scrollPocket = themeFrame.firstDescendant(withClassName: "NSScrollPocket") { + scrollPocket.isHidden = true + } } // MARK: NSWindow