From 5de30c0dce670e7f4d58e32bdbadd95784cbb2b3 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Mon, 30 Mar 2026 12:09:51 +0200 Subject: [PATCH] Revert "macOS: fix tab context menu opens on macOS 26 with titlebar tabs (#9831)" This reverts commit 894e8d91ba43e88fcff33f011dbb9f52618725c5, reversing changes made to 4a173052fb181580b1ea013555508b8f37c0407e. --- .../TitlebarTabsTahoeTerminalWindow.swift | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift index 6df1b14bc..2bf3bd42f 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift @@ -67,42 +67,6 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool viewModel.isMainWindow = false } - - /// On our Tahoe titlebar tabs, we need to fix up right click events because they don't work - /// naturally due to whatever mess we made. - override func sendEvent(_ event: NSEvent) { - guard viewModel.hasTabBar else { - super.sendEvent(event) - return - } - - let isRightClick = - event.type == .rightMouseDown || - (event.type == .otherMouseDown && event.buttonNumber == 2) || - (event.type == .leftMouseDown && event.modifierFlags.contains(.control)) - guard isRightClick else { - super.sendEvent(event) - return - } - - guard let tabBarView else { - super.sendEvent(event) - return - } - - guard !tabTitleEditor.handleRightMouseDown(event) else { - return - } - - let locationInTabBar = tabBarView.convert(event.locationInWindow, from: nil) - guard tabBarView.bounds.contains(locationInTabBar) else { - super.sendEvent(event) - return - } - - tabBarView.rightMouseDown(with: event) - } - // This is called by macOS for native tabbing in order to add the tab bar. We hook into // this, detect the tab bar being added, and override its behavior. override func addTitlebarAccessoryViewController(_ childViewController: NSTitlebarAccessoryViewController) {