Revert "macOS: fix tab context menu opens on macOS 26 with titlebar tabs (#9831)"

This reverts commit 894e8d91ba, reversing
changes made to 4a173052fb.
This commit is contained in:
Lukas
2026-03-30 12:09:51 +02:00
parent 5c5029b0c4
commit 5de30c0dce

View File

@@ -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) {