Skip to content

Detect stacks of maximized windows in the overlap offset and badge - #1813

Draft
MyronKoch wants to merge 1 commit into
rxhanson:mainfrom
MyronKoch:feat/maximize-stack-offset
Draft

Detect stacks of maximized windows in the overlap offset and badge#1813
MyronKoch wants to merge 1 commit into
rxhanson:mainfrom
MyronKoch:feat/maximize-stack-offset

Conversation

@MyronKoch

Copy link
Copy Markdown
Contributor

Stacking two maximized windows is the case where you most need to know something is buried — the top window covers the screen completely — but neither the overlap offset (#1762) nor the stacked-window badge (#1795) fires for it. Both quietly skip maximized windows.

Two causes:

  1. The offset never runs for maximize. It's gated on action.positionCycles, and .maximize is in that list's exclusion set. positionCycles describes whether an action cycles through sizes on repeat — which maximize doesn't — but it's consumed in exactly one place: this gate. Maximize doesn't cycle, yet two maximized windows still land exactly on top of each other, so the offset is let through explicitly.

  2. Screen-covering windows are skipped by both features. That exclusion is deliberate and load-bearing: a maximized window shares its origin with every half/corner placement, so matching one would offset all of them (Fix false positive overlap detection for half/third actions #1766). But it only needs to hold while the window being placed is smaller. Two windows that both cover the screen and share an origin are a genuine stack:

    • Offset: the exclusion now lifts only when the window being placed also covers the screen.
    • Badge: tiled windows still win — screen-covering windows form the stack only when the tiled ones don't — so ordinary layouts count exactly as before.

Placing a half onto a maximized window still ignores it, so #1766 stays fixed.

Note the offset needs somewhere to shift into, which gaps provide (maximize applies gaps unless applyGapsToMaximize is disabled). With no gaps a maximized window is flush to the screen edges and the existing clamping leaves it where it is — no offset, no harm.

Four unit tests cover the badge's new stack selection, including that a lone maximized window can't inflate the count.

Neither the overlap offset nor the stacked-window badge fired for two
maximized windows on top of each other - the case where the buried
window is least visible.

The offset is gated on positionCycles, which describes whether an action
cycles through sizes on repeat; maximize doesn't, but two maximized
windows still land on top of each other, so let it through that gate.

Both features also skip windows covering the screen, since a maximized
window shares its origin with every half and corner placement and would
otherwise offset all of them (rxhanson#1766). Narrow that: the offset lifts the
exclusion only when the window being placed also covers the screen, and
the badge forms a stack from screen-covering windows only when the tiled
ones don't - so ordinary placements behave exactly as before.
@MyronKoch
MyronKoch marked this pull request as draft August 11, 2026 19:26
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.

1 participant