fix: tabs show as separate windows sometimes on monterey (closes #2017)
This commit is contained in:
1 parent
fe38b53ff7
commit
0965a78d46
2 files changed
+6
-4
No files matched your search
@@ -72,7 +72,7 @@ class Spaces {
|
|||||||
static func windowsInSpaces(_ spaceIds: [CGSSpaceID], _ options: CGSCopyWindowsOptions) -> [CGWindowID] {
|
static func windowsInSpaces(_ spaceIds: [CGSSpaceID], _ options: CGSCopyWindowsOptions) -> [CGWindowID] {
|
||||||
var set_tags = ([] as CGSCopyWindowsTags).rawValue
|
var set_tags = ([] as CGSCopyWindowsTags).rawValue
|
||||||
var clear_tags = ([] as CGSCopyWindowsTags).rawValue
|
var clear_tags = ([] as CGSCopyWindowsTags).rawValue
|
||||||
return CGSCopyWindowsWithOptionsAndTags(cgsMainConnectionId, 0, spaceIds as CFArray, 2, &set_tags, &clear_tags) as! [CGWindowID]
|
return CGSCopyWindowsWithOptionsAndTags(cgsMainConnectionId, 0, spaceIds as CFArray, options.rawValue, &set_tags, &clear_tags) as! [CGWindowID]
|
||||||
}
|
}
|
||||||
|
|
||||||
static func isSingleSpace() -> Bool {
|
static func isSingleSpace() -> Bool {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Windows {
|
|||||||
// the first few thumbnails are the most commonly looked at; we pay special attention to them
|
// the first few thumbnails are the most commonly looked at; we pay special attention to them
|
||||||
static let criticalFirstThumbnails = 3
|
static let criticalFirstThumbnails = 3
|
||||||
|
|
||||||
// reordered list based on preferences, keeping the original index
|
/// reordered list based on preferences, keeping the original index
|
||||||
static func reorderList() {
|
static func reorderList() {
|
||||||
list.sort {
|
list.sort {
|
||||||
if let bool = sortByBooleanAttribute($0.isWindowlessApp, $1.isWindowlessApp) {
|
if let bool = sortByBooleanAttribute($0.isWindowlessApp, $1.isWindowlessApp) {
|
||||||
@@ -158,11 +158,13 @@ class Windows {
|
|||||||
list.forEachAsync { $0.updatesWindowSpace() }
|
list.forEachAsync { $0.updatesWindowSpace() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// tabs detection is a flaky work-around the lack of public API to observe OS tabs
|
||||||
|
/// see: https://github.com/lwouis/alt-tab-macos/issues/1540
|
||||||
static func detectTabbedWindows() {
|
static func detectTabbedWindows() {
|
||||||
let cgsWindowIds = Spaces.windowsInSpaces(Spaces.idsAndIndexes.map { $0.0 }, [])
|
let cgsWindowIds = Spaces.windowsInSpaces(Spaces.idsAndIndexes.map { $0.0 }, [.minimizedAndTabbed])
|
||||||
list.forEach {
|
list.forEach {
|
||||||
if let cgWindowId = $0.cgWindowId {
|
if let cgWindowId = $0.cgWindowId {
|
||||||
$0.isTabbed = !$0.isMinimized && !$0.isHidden && !cgsWindowIds.contains(cgWindowId)
|
$0.isTabbed = !cgsWindowIds.contains(cgWindowId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user