mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
feat: remove "active space" from filter list
This commit is contained in:
@@ -183,9 +183,24 @@ class Preferences {
|
||||
}
|
||||
// nextWindowShortcut used to be able to have modifiers already present in holdShortcut; we remove these
|
||||
migrateNextWindowShortcuts()
|
||||
// "Show windows from:" got the "Active Space" option removed
|
||||
migrateShowWindowsFrom()
|
||||
defaults.set(App.version, forKey: preferencesVersion)
|
||||
}
|
||||
|
||||
private static func migrateShowWindowsFrom() {
|
||||
["", "2"].forEach { suffix in
|
||||
if let spacesToShow = defaults.string(forKey: "spacesToShow" + suffix) {
|
||||
if spacesToShow == "2" {
|
||||
defaults.set("1", forKey: "screensToShow" + suffix)
|
||||
defaults.set("1", forKey: "spacesToShow" + suffix)
|
||||
} else if spacesToShow == "1" {
|
||||
defaults.set("1", forKey: "screensToShow" + suffix)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static func migrateNextWindowShortcuts() {
|
||||
["", "2"].forEach { suffix in
|
||||
if let oldHoldShortcut = defaults.string(forKey: "holdShortcut" + suffix),
|
||||
@@ -342,13 +357,11 @@ enum AppsToShowPreference: String, CaseIterable, MacroPreference {
|
||||
|
||||
enum SpacesToShowPreference: String, CaseIterable, MacroPreference {
|
||||
case all = "0"
|
||||
case active = "1"
|
||||
case visible = "2"
|
||||
|
||||
var localizedString: LocalizedString {
|
||||
switch self {
|
||||
case .all: return NSLocalizedString("All Spaces", comment: "")
|
||||
case .active: return NSLocalizedString("Active Space", comment: "")
|
||||
case .visible: return NSLocalizedString("Visible Spaces", comment: "")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ class Window {
|
||||
var screenFrameInQuartzCoordinates = screen.frame
|
||||
screenFrameInQuartzCoordinates.origin.y = NSMaxY(NSScreen.screens[0].frame) - NSMaxY(screen.frame)
|
||||
let windowRect = CGRect(origin: topLeftCorner, size: size)
|
||||
return windowRect.intersects(screenFrameInQuartzCoordinates) && Spaces.visibleSpaces.contains(spaceId)
|
||||
return windowRect.intersects(screenFrameInQuartzCoordinates)
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -196,7 +196,6 @@ class Windows {
|
||||
!window.isWindowlessApp &&
|
||||
!(!(Preferences.showFullscreenWindows[App.app.shortcutIndex] != .hide) && window.isFullscreen) &&
|
||||
!(!(Preferences.showMinimizedWindows[App.app.shortcutIndex] != .hide) && window.isMinimized) &&
|
||||
!(Preferences.spacesToShow[App.app.shortcutIndex] == .active && window.spaceId != Spaces.currentSpaceId) &&
|
||||
!(Preferences.spacesToShow[App.app.shortcutIndex] == .visible && !Spaces.visibleSpaces.contains(window.spaceId)) &&
|
||||
!(Preferences.screensToShow[App.app.shortcutIndex] == .showingAltTab && !window.isOnScreen(screen)) &&
|
||||
(Preferences.showTabsAsWindows || !window.isTabbed))
|
||||
|
||||
Reference in New Issue
Block a user