mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-27 09:43:55 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user