feat: add preference to show only non-active apps (closes #4691)

This commit is contained in:
lwouis committed 2025-08-27 19:50:32 +02:00
1 parent f489bd7d36
commit 4567550978
4 files changed
+7 -1

No files matched your search

+3
View File
@@ -289,6 +289,9 @@
/* No comment provided by engineer. */
"Never send crash reports" = "Never send crash reports";
/* No comment provided by engineer. */
"Non-active apps" = "Non-active apps";
/* No comment provided by engineer. */
"Normal" = "Normal";
+2
View File
@@ -362,11 +362,13 @@ enum WindowOrderPreference: CaseIterable, MacroPreference {
enum AppsToShowPreference: CaseIterable, MacroPreference {
case all
case active
case nonActive
var localizedString: LocalizedString {
switch self {
case .all: return NSLocalizedString("All apps", comment: "")
case .active: return NSLocalizedString("Active app", comment: "")
case .nonActive: return NSLocalizedString("Non-active apps", comment: "")
}
}
}
+1 -1
View File
@@ -59,7 +59,7 @@ class Preferences {
"showTitles": ShowTitlesPreference.windowTitle.indexAsString,
"appsToShow": AppsToShowPreference.all.indexAsString,
"appsToShow2": AppsToShowPreference.active.indexAsString,
"appsToShow3": AppsToShowPreference.all.indexAsString,
"appsToShow3": AppsToShowPreference.nonActive.indexAsString,
"appsToShow4": AppsToShowPreference.all.indexAsString,
"spacesToShow": SpacesToShowPreference.all.indexAsString,
"spacesToShow2": SpacesToShowPreference.all.indexAsString,
+1
View File
@@ -365,6 +365,7 @@ class Windows {
}
} ?? false) &&
!(Preferences.appsToShow[App.app.shortcutIndex] == .active && window.application.pid != NSWorkspace.shared.frontmostApplication?.processIdentifier) &&
!(Preferences.appsToShow[App.app.shortcutIndex] == .nonActive && window.application.pid == NSWorkspace.shared.frontmostApplication?.processIdentifier) &&
!(!(Preferences.showHiddenWindows[App.app.shortcutIndex] != .hide) && window.isHidden) &&
((Preferences.showWindowlessApps[App.app.shortcutIndex] != .hide && window.isWindowlessApp) ||
!window.isWindowlessApp &&