Skip to content

Ignore mostly offscreen windows to avoid raise loops with tiling WMs - #286

Open
dor-eon wants to merge 1 commit into
sbmpost:masterfrom
dor-eon:ignore-mostly-offscreen-windows
Open

Ignore mostly offscreen windows to avoid raise loops with tiling WMs#286
dor-eon wants to merge 1 commit into
sbmpost:masterfrom
dor-eon:ignore-mostly-offscreen-windows

Conversation

@dor-eon

@dor-eon dor-eon commented Jul 9, 2026

Copy link
Copy Markdown

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 the EXPERIMENTAL_FOCUS_FIRST focus-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

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>
@sbmpost

sbmpost commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Please check #256 first. It might already fix the aerospace issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants