fix: reject ordered-out windows during app discovery - #460
Merged
acsandmann merged 2 commits intoAug 30, 2026
Conversation
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.
Summary
Reject WindowServer records that are explicitly ordered out before app discovery uses them as evidence that an AX window has a visible CG peer.
This prevents a closed or invisible Electron window retained by AX and WindowServer from being rediscovered and reinserted into a tiled layout.
Reproduction
rift-cli query windowsbefore and after.In the captured reproduction, the before query had four legitimate windows. The after query re-added the same pre-existing Vesktop identity (WindowServer ID
121366) as a non-floating tile atx=1368, displacing the Code column fromx=1368tox=2276. This was a retained identity, not a newly created user window.I reproduced this on the preceding fork build and confirmed that the patched build stopped this sequence from creating the ghost tile.
Root cause and fix
State::visible_window_server_info_mapcorrelates an application'sAXWindowswith an ID-targeted WindowServer query. That query can return a retained WindowServer record after a window is ordered out.Previously, every returned record entered the visible-peer map.
has_visible_cg_peeraccepted it,refresh_visible_windowsincluded itsWindowIdinknown_visible, and downstream discovery could re-admit it. Existing stale cleanup consults ordered state, but cannot help when positive discovery labels the same record as visible again.The patch checks
window_ordered_infor each returned record. ExplicitSome(false)records are excluded and traced;Some(true)and inconclusiveNoneremain eligible. A failed private query during WindowServer/display churn is not treated as proof that a legitimate window disappeared.This runs only at existing discovery boundaries. It adds no polling, application-specific exception, or geometry threshold.
Tests
Added
retained_ordered_out_record_is_excluded_from_visible_map, which verifies map membership forSome(true),Some(false), andNoneordered-state results.Local verification on macOS after rebasing onto
74ce00d:Related work and scope