Repository navigation
Conversation
…vel_destroyed finds the window in a registry of toplevels, not in the space, which refresh() may have emptied of it first
This branch has not been deployed
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
When a client disconnects, its surfaces die at once, but
toplevel_destroyedruns only at the next dispatch. Ifspace.refresh()runs between the two, it drops the dead window from the space.toplevel_destroyedlooked for the window inspace.elements(), did not find it, and took the early path. The window's foreign-toplevel handles were never closed. A taskbar kept a ghost button (and a thumbnail) for a program that had exited.Fix
state.rs: new fieldxdg_toplevel_windows: Vec<Window>, a registry of every xdg toplevel's window fromnew_topleveltotoplevel_destroyed.handlers/xdg_shell.rs:new_toplevelpushes the window into the registry.toplevel_destroyedtakes the window out of the registry (take_xdg_toplevel_window) instead of searching the space, so the normal close path runs: taskbar handles, decoration state and the runtime entry are removed. The early path remains for a surface that is not in the registry.Tests
No test is added.
cargo test --workspacepasses, except two tests that also fail on upstreammainin our environment:evaluator::tests::embedded_runtime_ipc_does_not_leak_fds_across_reloadsandinput_method_keyboard_grab_gets_the_keymap_of_the_keys_it_is_sent.This change has been running daily in the author's own session (a Windows-7-like desktop on ShojiWM).