| | |
| | | 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) |
| | |
| | | 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] { |
| | | let spaceCount = currentViewModel?.spaceCount ?? 0 |
| | | let appCount = currentViewModel?.appShelf.count ?? 0 |