Skip to content

Commit 42d8c5f

Browse files
liangyuetianclaude
andcommitted
fix: Exclude desktop widgets from tile-all and cascade-all operations (rxhanson#1707)
Filter out windows belonging to Dock, WindowManager (Stage Manager), and Notification Center (which hosts desktop widgets on macOS Sonoma+) in getAllWindowElements(). This prevents desktop widgets from being included in multi-window operations like tile-all, cascade-all, and reverse-all. Fixes rxhanson#1701 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2d55342 commit 42d8c5f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Rectangle/AccessibilityElement.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,14 @@ extension AccessibilityElement {
378378
return AccessibilityElement(pid).windowElements?.first { $0.windowId == windowId }
379379
}
380380

381+
private static let excludedProcessNames: Set<String> = ["Dock", "WindowManager", "Notification Center"]
382+
381383
static func getAllWindowElements() -> [AccessibilityElement] {
382-
return WindowUtil.getWindowList().uniqueMap { $0.pid }.compactMap { AccessibilityElement($0).windowElements }.flatMap { $0 }
384+
return WindowUtil.getWindowList()
385+
.filter { !excludedProcessNames.contains($0.processName ?? "") }
386+
.uniqueMap { $0.pid }
387+
.compactMap { AccessibilityElement($0).windowElements }
388+
.flatMap { $0 }
383389
}
384390
}
385391

0 commit comments

Comments
 (0)