Ignore mostly offscreen windows to avoid raise loops with tiling WMs - #286
Open
dor-eon wants to merge 1 commit into
Open
Ignore mostly offscreen windows to avoid raise loops with tiling WMs#286dor-eon wants to merge 1 commit into
dor-eon wants to merge 1 commit into
Conversation
Window managers like AeroSpace hide windows of inactive workspaces by moving them almost entirely offscreen, keeping a ~1px sliver visible in a bottom corner (macOS refuses to place windows fully outside the visible area). When the cursor reaches that corner, AutoRaise raises the sliver window, which switches the workspace and parks the previously visible window in the same corner - causing an infinite focus/raise loop. Skip raising/focusing any window with fewer than 4px visible on its best-matching screen. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
Please check #256 first. It might already fix the aerospace issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tiling window managers like AeroSpace "hide" windows of inactive workspaces by moving them almost entirely offscreen, keeping a ~1px sliver visible in a bottom corner of the display (macOS refuses to place windows fully outside the visible area).
When the mouse reaches that corner, AutoRaise's hit-test finds the sliver window and raises it. Raising it switches the workspace, which parks the previously visible window in the same corner — so AutoRaise immediately raises that one, switching back. The result is an infinite focus/raise loop (rapid workspace flickering) whenever the cursor sits in that corner.
Fix
Add a
mostly_offscreen()check: compute the window's visible intersection with each screen (flipping AX top-left coordinates to NSScreen bottom-left ones), and skip raising/focusing any window with fewer than 4px visible on its best-matching screen.A genuinely usable window is never that close to fully offscreen, so this shouldn't affect normal operation. The check gates
needs_raise, so it also covers theEXPERIMENTAL_FOCUS_FIRSTfocus-only path.Testing
Running this patch on macOS (Darwin 25, Apple Silicon) with AeroSpace + AutoRaise 5.6 (built both stock and with
-DEXPERIMENTAL_FOCUS_FIRST) since July 2026: the corner loop is gone, and normal focus-follows-mouse behavior is unaffected.🤖 Generated with Claude Code