Repository navigation
fix(window): only record activatedBy from the declared opener - #137
Merged
Merged
Conversation
`xdg_activation_v1` `request_activation` fell back to the keyboard-focused surface when the token declared no requesting surface. For programmatic windows (e.g. a browser restoring its session) that recorded whatever was focused as `activatedBy`, so the shell attached the window as a dialog of an unrelated tile. Opening Firefox and Zen Browser together made a Zen window a dialog of Firefox; closing Firefox then cascaded a close into Zen (#128 follow-up). Record the relation only from the token's declared surface. A token with no declared opener now records no relation and the window is matched normally. Update the field/patch docs and document the decision — plus the same-application-scoped fallback to reinstate if it proves to lose useful hints — in the matching algorithm spec. Refs #128.
Merged
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
Follow-up to #128. Opening Firefox and Zen Browser in quick succession made a Zen window attach as a dialog of Firefox, so closing Firefox cascaded a close into Zen and left its other window unresponsive.
Root cause
The compositor's
xdg_activation_v1handler recordedactivatedByfrom the token's declared surface, but when the token declared none it fell back to the currently keyboard-focused surface (src/embedder/wayland/xdg.rs):For a programmatic window (a browser restoring its session) that turns
activatedByinto "whatever was focused". The shell then takes the further-opening branch (dialogOwnerFromRelation: clientparent→activatedBy→ provenance → process sibling) and, sinceactivatedBywas Firefox's window, attaches the Zen window as a dialog of Firefox — even though its pid/cgroup says it belongs to the Zen tile.Fix
Record
activatedByonly from the token's declared surface. A token with no declared opener records no relation, so the window is matched normally (its own app's tile) instead of becoming a dialog of the focused app.src/embedder/wayland/xdg.rs: drop the keyboard-focus fallback (and the now-unused import).src/embedder/meta_window_state/meta_window.rs: field/patch docs state the relation is the client-declared opener only.docs/specifications/matching_algorithm.md: document the behavior and note that if it proves to drop useful same-application hints, the fallback should be reinstated scoped to the focused surface of the same application (not unconditionally).No change to the matching algorithm's precedence, so same-app multi-tile dialog ownership is untouched.
Verification
cargo check— clean (no new warnings).cargo test— 216 passed.cargo fmt --check— clean.Refs #128.