Repository navigation
Conversation
|
Reopened; closed by accident. |
|
Hit this with mapped windows, not only the never-mapped Two I did not see a |
|
Confirmed, that case is covered. The prune is mapping-agnostic: refreshToplevels() now drops any toplevel whose address is missing from the j/clients reply (src/wayland/hyprland/ipc/connection.cpp), so the two cmd.exe entries vanish on the next refresh whether or not closewindow ever arrived. No need to know if the event was lost or never sent, the clients reply is the source of truth. One timing note: refreshToplevels() currently runs on connect and configreloaded, so mid-session the stale marks clear on the next config reload rather than instantly. If your setup shows them persisting past that after this head (b125150), reopen the thread with a log and we can trigger reconciliation earlier. |
Describe your changes
refreshToplevels() now deletes toplevels that are not in the j/clients reply.
Entries can exist without a matching client because title and urgent events
create them before openwindow does, and Hyprland sends no closewindow for X11
helper windows it never mapped. The old code only added and updated, so those
entries stayed in Hyprland.toplevels until the shell restarted. This also
cleans up entries that a running session can still have after #1465.
Windows opened while the request was in flight can be missing from the reply,
so they are exempt from the prune.
Details and descisions
Same teardown as the closewindow handler, in two passes like refreshWorkspaces.
The in-flight guard covers windows that open during the request, so they are
not pruned just because an older reply omits them. #1490 does the opposite
side of the same race (a window that closes during the request is not re-added
from the stale reply); there is a small overlap in this function that needs a
rebase once one lands. #1465 stops title events from creating entries at all;
this PR prunes whatever already exists and keeps refreshes authoritative.
References #1450, #1268, #1465, #1490.
AI context
The repro (socket2 event capture) and the patch were prepared with AI assistance. The submitter reviewed the code and wrote this description.Open concerns
refreshToplevels only runs on shell start, config reload, and explicit calls
from shell QML, so state is reconciled at those points, not continuously.
With #1465 merged, the never-mapped class is prevented at creation; this PR
removes whatever is already there and keeps refreshes authoritative.
Participation
Happy to iterate on this and help test; the ghost windows showed up in the
window switcher I use daily.