aerospace fork
Something went wrong. Try again.
12345678910111213141516import AppKit
@MainActor var currentlyManipulatedWithMouseWindowId: UInt32? = nilvar isLeftMouseButtonDown: Bool { NSEvent.pressedMouseButtons == 1 }
@MainActorfunc isManipulatedWithMouse(_ window: Window) async throws -> Bool { try await (!window.isHiddenInCorner && // Don't allow to resize/move windows of hidden workspaces isLeftMouseButtonDown && (currentlyManipulatedWithMouseWindowId == nil || window.windowId == currentlyManipulatedWithMouseWindowId)) .andAsync { @Sendable @MainActor in try await getNativeFocusedWindow(.cancellable) == window }}
/// Same motivation as in monitorFrameNormalizedvar mouseLocation: CGPoint { NSEvent.mouseLocation.withYAxisFlipped }