From 81b5a5f847e74fe1106829b13db2cccda8dd5798 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Fri, 19 Jun 2026 19:48:59 +0800
Subject: [PATCH] Fix horizontal app index key handling
---
C1.source/Sources/Aligner/QuickSwitchSessionController.swift | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
index 7fa4f39..18d84f0 100644
--- a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
+++ b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
@@ -86,7 +86,7 @@
private var lifecycleResidualOverlayWindows = 0
private var lifecycleResidualVisibleOverlayWindows = 0
var onSnapshotUpdated: (() -> Void)?
- var onOpenSettings: (() -> Void)?
+ var onToggleWaterfallViewMode: (() -> Void)?
private struct PendingCloseVerification {
let request: QuickSwitchCloseRequest
@@ -213,8 +213,8 @@
view.onBackgroundClick = { [weak self] in
self?.handleBackgroundClick() ?? false
}
- view.onOpenSettings = { [weak self] in
- self?.onOpenSettings?()
+ view.onToggleWaterfallViewMode = { [weak self] in
+ self?.onToggleWaterfallViewMode?()
}
view.setSuppressEventInput(!debugMouseSequence.isEmpty || !debugKeySequence.isEmpty)
view.onRequestClose = { [weak self] request in
@@ -280,7 +280,27 @@
func retriggerFromShortcut() {
DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut")
- show()
+ guard isVisible else {
+ show()
+ return
+ }
+
+ guard currentViewModel != nil else {
+ DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut.noSnapshot", [
+ "action": "fallbackShow"
+ ])
+ show()
+ return
+ }
+
+ let didCycle = view.hoverNextAppGroupIndex()
+ DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut.hoverApp", [
+ "didCycle": didCycle
+ ])
+
+ if !didCycle {
+ show()
+ }
}
func setWaterfallViewMode(_ mode: QuickSwitchWaterfallViewMode) {
--
Gitblit v1.9.3