feat: remove "active space" from filter list
This commit is contained in:
1 parent
b5b3c38fec
commit
4623e5b7c4
3 files changed
+16
-4
No files matched your search
@@ -183,9 +183,24 @@ class Preferences {
|
|||||||
}
|
}
|
||||||
// nextWindowShortcut used to be able to have modifiers already present in holdShortcut; we remove these
|
// nextWindowShortcut used to be able to have modifiers already present in holdShortcut; we remove these
|
||||||
migrateNextWindowShortcuts()
|
migrateNextWindowShortcuts()
|
||||||
|
// "Show windows from:" got the "Active Space" option removed
|
||||||
|
migrateShowWindowsFrom()
|
||||||
defaults.set(App.version, forKey: preferencesVersion)
|
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() {
|
private static func migrateNextWindowShortcuts() {
|
||||||
["", "2"].forEach { suffix in
|
["", "2"].forEach { suffix in
|
||||||
if let oldHoldShortcut = defaults.string(forKey: "holdShortcut" + suffix),
|
if let oldHoldShortcut = defaults.string(forKey: "holdShortcut" + suffix),
|
||||||
@@ -342,13 +357,11 @@ enum AppsToShowPreference: String, CaseIterable, MacroPreference {
|
|||||||
|
|
||||||
enum SpacesToShowPreference: String, CaseIterable, MacroPreference {
|
enum SpacesToShowPreference: String, CaseIterable, MacroPreference {
|
||||||
case all = "0"
|
case all = "0"
|
||||||
case active = "1"
|
|
||||||
case visible = "2"
|
case visible = "2"
|
||||||
|
|
||||||
var localizedString: LocalizedString {
|
var localizedString: LocalizedString {
|
||||||
switch self {
|
switch self {
|
||||||
case .all: return NSLocalizedString("All Spaces", comment: "")
|
case .all: return NSLocalizedString("All Spaces", comment: "")
|
||||||
case .active: return NSLocalizedString("Active Space", comment: "")
|
|
||||||
case .visible: return NSLocalizedString("Visible Spaces", comment: "")
|
case .visible: return NSLocalizedString("Visible Spaces", comment: "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class Window {
|
|||||||
var screenFrameInQuartzCoordinates = screen.frame
|
var screenFrameInQuartzCoordinates = screen.frame
|
||||||
screenFrameInQuartzCoordinates.origin.y = NSMaxY(NSScreen.screens[0].frame) - NSMaxY(screen.frame)
|
screenFrameInQuartzCoordinates.origin.y = NSMaxY(NSScreen.screens[0].frame) - NSMaxY(screen.frame)
|
||||||
let windowRect = CGRect(origin: topLeftCorner, size: size)
|
let windowRect = CGRect(origin: topLeftCorner, size: size)
|
||||||
return windowRect.intersects(screenFrameInQuartzCoordinates) && Spaces.visibleSpaces.contains(spaceId)
|
return windowRect.intersects(screenFrameInQuartzCoordinates)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -196,7 +196,6 @@ class Windows {
|
|||||||
!window.isWindowlessApp &&
|
!window.isWindowlessApp &&
|
||||||
!(!(Preferences.showFullscreenWindows[App.app.shortcutIndex] != .hide) && window.isFullscreen) &&
|
!(!(Preferences.showFullscreenWindows[App.app.shortcutIndex] != .hide) && window.isFullscreen) &&
|
||||||
!(!(Preferences.showMinimizedWindows[App.app.shortcutIndex] != .hide) && window.isMinimized) &&
|
!(!(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.spacesToShow[App.app.shortcutIndex] == .visible && !Spaces.visibleSpaces.contains(window.spaceId)) &&
|
||||||
!(Preferences.screensToShow[App.app.shortcutIndex] == .showingAltTab && !window.isOnScreen(screen)) &&
|
!(Preferences.screensToShow[App.app.shortcutIndex] == .showingAltTab && !window.isOnScreen(screen)) &&
|
||||||
(Preferences.showTabsAsWindows || !window.isTabbed))
|
(Preferences.showTabsAsWindows || !window.isTabbed))
|
||||||
|
|||||||
Reference in new issue
Block a user