diff --git a/macos/Ghostty.xcodeproj/project.pbxproj b/macos/Ghostty.xcodeproj/project.pbxproj index ad2c54ca9..9bd36eaad 100644 --- a/macos/Ghostty.xcodeproj/project.pbxproj +++ b/macos/Ghostty.xcodeproj/project.pbxproj @@ -152,7 +152,6 @@ Helpers/AppInfo.swift, Helpers/CodableBridge.swift, Helpers/Cursor.swift, - Helpers/DraggableWindowView.swift, Helpers/ExpiringUndoManager.swift, "Helpers/Extensions/Double+Extension.swift", "Helpers/Extensions/EventModifiers+Extension.swift", diff --git a/macos/Sources/Ghostty/Surface View/SurfaceDragSource.swift b/macos/Sources/Ghostty/Surface View/SurfaceDragSource.swift index 21416ac75..059428b15 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceDragSource.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceDragSource.swift @@ -104,7 +104,11 @@ extension Ghostty { /// Whether the current drag was cancelled by pressing escape. private var dragCancelledByEscape: Bool = false - + + /// Original value of `window.isMovable` to restore + /// when the mouse exits. + private var isWindowMovable: Bool? + deinit { if let escapeMonitor { NSEvent.removeMonitor(escapeMonitor) @@ -131,10 +135,18 @@ extension Ghostty { } override func mouseEntered(with event: NSEvent) { + // Temporarily disable `isMovable` to fix + // https://github.com/ghostty-org/ghostty/issues/10110 + isWindowMovable = window?.isMovable + window?.isMovable = false onHoverChanged?(true) } override func mouseExited(with event: NSEvent) { + if let isWindowMovable { + window?.isMovable = isWindowMovable + self.isWindowMovable = nil + } onHoverChanged?(false) } diff --git a/macos/Sources/Helpers/DraggableWindowView.swift b/macos/Sources/Helpers/DraggableWindowView.swift deleted file mode 100644 index 8d88e2f66..000000000 --- a/macos/Sources/Helpers/DraggableWindowView.swift +++ /dev/null @@ -1,19 +0,0 @@ -import Cocoa -import SwiftUI - -struct DraggableWindowView: NSViewRepresentable { - func makeNSView(context: Context) -> DraggableWindowNSView { - return DraggableWindowNSView() - } - - func updateNSView(_ nsView: DraggableWindowNSView, context: Context) { - // No need to update anything here - } -} - -class DraggableWindowNSView: NSView { - override func mouseDown(with event: NSEvent) { - guard let window = self.window else { return } - window.performDrag(with: event) - } -}