| | |
| | | private let windowCloseService: any WindowCloseServiceProtocol |
| | | private let systemCriticalWindowDetector: any SystemCriticalWindowDetecting |
| | | private let disableScreenshotRefresh: Bool |
| | | private let waterfallViewMode: QuickSwitchWaterfallViewMode |
| | | private var waterfallViewMode: QuickSwitchWaterfallViewMode |
| | | private var closeConfirmationRequired: Bool |
| | | private let onCloseConfirmationDisabled: (() -> Void)? |
| | | private let debugOverlayWidth: CGFloat? |
| | |
| | | private var lifecycleResidualOverlayWindows = 0 |
| | | private var lifecycleResidualVisibleOverlayWindows = 0 |
| | | var onSnapshotUpdated: (() -> Void)? |
| | | var onOpenSettings: (() -> Void)? |
| | | |
| | | private struct PendingCloseVerification { |
| | | let request: QuickSwitchCloseRequest |
| | |
| | | view.onBackgroundClick = { [weak self] in |
| | | self?.handleBackgroundClick() ?? false |
| | | } |
| | | view.onOpenSettings = { [weak self] in |
| | | self?.onOpenSettings?() |
| | | } |
| | | view.setSuppressEventInput(!debugMouseSequence.isEmpty || !debugKeySequence.isEmpty) |
| | | view.onRequestClose = { [weak self] request in |
| | | self?.requestClose(request) |
| | |
| | | func retriggerFromShortcut() { |
| | | DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut") |
| | | show() |
| | | } |
| | | |
| | | func setWaterfallViewMode(_ mode: QuickSwitchWaterfallViewMode) { |
| | | guard waterfallViewMode != mode else { return } |
| | | |
| | | waterfallViewMode = mode |
| | | DevelopmentDiagnostics.log("quickSwitch.session.waterfallViewModeChanged", [ |
| | | "mode": mode.rawValue, |
| | | "visible": isVisible, |
| | | "hasViewModel": currentViewModel != nil |
| | | ]) |
| | | |
| | | view.setWaterfallViewMode(mode) |
| | | if isVisible, let currentViewModel { |
| | | view.applyProjected(viewModel: currentViewModel) |
| | | } |
| | | onSnapshotUpdated?() |
| | | } |
| | | |
| | | func reportDictionary() -> [String: Any] { |
| | |
| | | "result": Self.closeResultString(result) |
| | | ]) |
| | | if result == .requested { |
| | | suppressCloseTarget(request) |
| | | DevelopmentDiagnostics.log("quickSwitch.close.request.refreshAfterClose", [ |
| | | "targetKind": request.kindDescription, |
| | | "appGroupIndex": request.appGroupIndex, |
| | | "appName": request.appName, |
| | | "windowID": request.windowID |
| | | "windowID": request.windowID, |
| | | "optimisticRemove": false |
| | | ]) |
| | | pendingCloseVerification = PendingCloseVerification( |
| | | request: request, |
| | |
| | | let fixtureCandidateFiltering: Bool |
| | | let fixtureActivation: Bool |
| | | let fixtureSpaceFilter: Bool |
| | | let fixtureSplitView: Bool |
| | | let debugHoveredAppGroupIndex: Int? |
| | | let debugOverlayWidth: CGFloat? |
| | | let debugKeySequence: [String] |
| | |
| | | fixtureCandidateFiltering: arguments.contains("--round01-fixture-candidate-filtering"), |
| | | fixtureActivation: arguments.contains("--round01-fixture-window-activation"), |
| | | fixtureSpaceFilter: arguments.contains("--round01-fixture-space-filter"), |
| | | fixtureSplitView: arguments.contains("--round01-fixture-split-view"), |
| | | debugHoveredAppGroupIndex: intValue(for: "--round01-debug-hover-app-index", in: arguments), |
| | | debugOverlayWidth: cgFloatValue(for: "--round01-debug-overlay-width", in: arguments), |
| | | debugKeySequence: stringListValue(for: "--round01-debug-key-sequence", in: arguments), |