Repository navigation
Description
Summary
With Window Snapping enabled in Multitouch (Snap windows by dragging / windowSnapping = 1), clicking or dragging windows while an Electron/Chromium app (for example, an IDE actively streaming output) is momentarily unresponsive to Accessibility IPC causes multi-second main-thread hangs (~9s observed in sample). Disabling Snap windows by dragging immediately eliminates the hangs.
Environment
- macOS: 26.7.3 (25G342)
- Hardware: MacBookPro16,2 (Intel)
- Multitouch: 2.1.2 (236)
- Settings:
windowSnapping = 1, macOS native edge tiling disabled
Root Cause (sample analysis)
Sampling Multitouch during a hang showed ~9.2s spent blocked synchronously on the main thread across three consecutive unbounded Accessibility IPC calls (using the default ~3–6s AXUIElement messaging timeout each):
AXUIElementCopyAttributeValuefor.role(~3.03s)AXUIElementCopyAttributeValuefor.windows(~3.05s)_AXUIElementCopyElementAtPositionIncludeIgnored(~3.07s)
Reproducing and sampling against the open-source rxhanson/Rectangle codebase confirmed two unbounded cascading AX paths on the main thread in SnappingManager:
getWindowElementUnderCursor: cascades.windows->systemWide.getElementAtPosition->frontmost, andleftMouseDraggedretries up to 20 times on failure, compounding stalls.checkFullScreen()->getFrontWindowElement(): cascades.focusedWindow->.windows->systemWide.focusedUIElement, andAccessibilityElement(pid)also performs an extra.roleIPC call insideapplicationElement.
Proposed Fixes
Approach 1: Minimal synchronous fix (PR submitted to Rectangle)
Submitted in rxhanson/Rectangle#1988:
- Bound
SnappingManager's AX lookups (getWindowElementUnderCursorandcheckFullScreen()) to Rectangle's existing0.25smessaging timeout convention (already used inOverlapOffsetGeometry,StackBadgeManager,StackCycleManager, andNewWindowActionManager). - Short-circuit cascading fallbacks and
leftMouseDraggedretries immediately when an AX lookup times out or hits the app's own interactive window. - Skip the redundant
.roleIPC lookup when anAccessibilityElementis already created from a PID. - Short-circuit
checkFullScreen()viaNSApp.windowswhen the frontmost app is the app itself. - Local
sampleverification on Rectangle confirmed multi-second stalls dropped to a single bounded timeout with no cascading fallbacks or drag retries, and all unit tests pass (796 passed, 0 failed, 11 skipped).
Approach 2: Architectural option (background serial queue)
If you prefer to eliminate even the bounded 0.25s synchronous wait on the main thread during app/space/display transitions, checkFullScreen() (and/or AX window queries) could be moved to a dedicated background serial DispatchQueue with a generation counter (similar to TitleBarManager / StackCycleManager), applying the result back on the main thread only if the generation still matches. We kept PR #1988 synchronous to preserve SnappingManager's existing contract and unit tests, but wanted to flag this option in case you prefer it for Multitouch / Rectangle Pro.
Activity
rxhanson commentedon Nov 29, 2026
Thanks! I'll prioritize this so it makes it into a MT/RP release within the next few days. I'll dive deeper and see if approach 2 is my desired approach as well.
rxhanson commentedon Dec 4, 2026
This was rolled into Multitouch (2.2) & Rectangle Pro (3.104) releases this week, so I'll close this out.