Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435import AppKitimport Foundationimport ParcelCoreimport ParcelIPC
@MainActorenum AppFixtureChipInput { static func middleClick( arguments: [String], state: State, environment: [String: String] = ProcessInfo.processInfo.environment ) throws { guard environment["PARCEL_E2E"] == "1", arguments.count == 1, let number = UInt32(arguments[0]), number > 0, let window = state.windows[WindowID(rawValue: number)], NSRunningApplication(processIdentifier: window.app.pid)?.executableURL?.lastPathComponent == "FixtureApp" else { throw IPCError( code: "invalid_command", message: AppText.string("Fixture chip input requires a managed fixture window in e2e mode.")) } let buttons = NSApplication.shared.windows.compactMap(\.contentView) .filter { $0.accessibilityRole() == .tabGroup } .flatMap(\.subviews).compactMap { $0 as? NSButton } guard let button = buttons.first(where: { $0.tag == Int(number) }), let event = CGEvent( mouseEventSource: nil, mouseType: .otherMouseDown, mouseCursorPosition: .zero, mouseButton: .center), let input = NSEvent(cgEvent: event) else { throw IPCError( code: "invalid_command", message: AppText.string("The fixture's stack chip is not available.")) } button.otherMouseDown(with: input) }}