Repository navigation
hyprland/ipc: don't bring back windows that already closed - #1490
Open
samanyudas wants to merge 1 commit into
Open
samanyudas wants to merge 1 commit into
samanyudas wants to merge 1 commit into
Conversation
A window that closes while `refreshToplevels()` is waiting for `j/clients` can come back as a ghost. Quickshell handles `closewindow` first, then the older reply re-creates the window. Nothing removes it again until the shell restarts (quickshell-mirror#1268).
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.
Describe your changes
A window that closes while
refreshToplevels()is waiting forj/clientscan come back as a ghost. Quickshell handlesclosewindowfirst, then the older reply re-creates the window. Nothing removes it again until the shell restarts (#1268).So now Quickshell remembers windows that close while it waits, and skips them in the reply.
Details and descisions
I only skip windows I know closed. Removing every window missing from the reply would also remove windows that opened after the reply was made.
openwindowclears the note, because Hyprland reuses addresses.AI context (Claude Opus 5.5 helped find and fix this)
A Cap user hit this through Omarchy 4.5's bar. The bar ignores clicks while a fullscreen window is open on its monitor. After Cap's screen picker closed, the bar stayed dead until they restarted the shell (CapSoftware/Cap#4119).
The repro branch makes it happen every time. It runs Quickshell against a fake Hyprland server that sends
closewindowbefore the oldj/clientsreply. Runrepro-1268/run.sh <path-to-quickshell>from https://github.com/samanyudas/quickshell/tree/repro/1268-fake-hyprland.9b0f339On real Hyprland 0.56.2, master brought back 29 closed windows in 30 tries. This branch brought back none.
Quickshell only notes closes while a reply is pending. It clears the notes when the reply arrives, even if the request failed.
openwindowclears an address first thing, so a new window that reuses the address is never skipped.Open concerns
An existing window can still get stale fields from an old reply. That's the same race, but it fixes itself on the next refresh, so I left it out.
The same race exists for workspaces (#1250) and window moves (#1467). Windows created from
windowtitlev2that never map are a separate case (#1450). This PR doesn't touch them.Participation
I will follow the review, make changes and like to learn this part of the code.