mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-21 00:48:36 +03:00

This breaks split resizing. Removing this doesn't seem to have negative effects for hidden titlebars (which it was originally made for).
22 lines
555 B
Swift
22 lines
555 B
Swift
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
|
|
}
|
|
}
|