Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import Foundationpublic import ParcelCoreimport ParcelIPC
extension ParcelEngine { public func alwaysFloat(window: WindowID) async throws -> EngineCommandResult { guard isRunning else { throw EngineError.stopped } guard !spaceCommandRunning else { throw spaceFailure(.busy) } guard snapshot.state.windows[window] != nil, observations[window] != nil else { throw IPCError(code: "window_not_found", message: String(localized: "Window not found.", bundle: .module)) } try Task.checkCancellation() let id = UUID() return try await withTaskCancellationHandler { try await withCheckedThrowingContinuation { reply in guard !Task.isCancelled else { reply.resume(throwing: CancellationError()) return } finishCommand( Pending(event: .commandIssued(.alwaysFloat), reply: reply, commandID: id), effects: [.saveFloatingRule(window)]) } } onCancel: { Task { @MainActor [weak self] in self?.cancelCommand(id) } } }}