macos: remove EventSinkHostingView

This was breaking various other features:

  - Popovers stopped working
  - Split divider drag gestures stopped working

For now we document the top part of the window is draggable... we
can look into removing that limitation later.
This commit is contained in:
Mitchell Hashimoto
2024-09-20 21:59:07 -07:00
parent 2c44e20860
commit c6bbdfb7bf
4 changed files with 4 additions and 27 deletions

View File

@@ -328,7 +328,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
}
// Initialize our content view to the SwiftUI root
window.contentView = EventSinkHostingView(rootView: TerminalView(
window.contentView = NSHostingView(rootView: TerminalView(
ghostty: self.ghostty,
viewModel: self,
delegate: self

View File

@@ -1,21 +0,0 @@
import SwiftUI
/// Custom subclass of NSHostingView which sinks events so that we can
/// stop the window from receiving events originating from within this view.
class EventSinkHostingView<Content: View>: NSHostingView<Content> {
override var acceptsFirstResponder: Bool {
return true
}
override func becomeFirstResponder() -> Bool {
return true
}
override func acceptsFirstMouse(for event: NSEvent?) -> Bool {
return true
}
override var mouseDownCanMoveWindow: Bool {
return false
}
}