fix: switcher could sometimes show with no window pre-selected

This commit is contained in:
lwouis committed 2026-01-24 13:39:24 +01:00
1 parent 9b5e43eec5
commit 3e95f77cc0
1 file changed
+4 -4
+4 -4
View File
@@ -336,10 +336,10 @@ class Windows {
static func getLastFocusedOrderWindowIndex() -> Int? { static func getLastFocusedOrderWindowIndex() -> Int? {
var index: Int? = nil var index: Int? = nil
var lastFocusOrderMin = Int.max var lastFocusOrderMin = Int.max
list.enumerated().forEach { for (offset, w) in list.enumerated() {
if !$0.element.isWindowlessApp && $0.element.lastFocusOrder < lastFocusOrderMin { if !w.isWindowlessApp && w.shouldShowTheUser && w.lastFocusOrder < lastFocusOrderMin {
lastFocusOrderMin = $0.element.lastFocusOrder lastFocusOrderMin = w.lastFocusOrder
index = $0.offset index = offset
} }
} }
return index return index