Open links with open::that_detached to avoid freezing the UI - #186
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UL2Y1HFGgYbQcyhBsUa3DU
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.
Both link-opening call sites used open::that, which spawns the handler and waits for it to exit. On Linux that means xdg-open, which does not return until the browser it launched exits — so if no browser was already running, the UI thread sat in waitpid for the browser's entire lifetime and the window was frozen, ignoring input and burning no CPU. Switched both to open::that_detached, the non-blocking variant of the same crate.
This was diagnosed on a live desktop from /proc on the frozen process. A separate issue was observed after releasing the wait — the process went to ~200% CPU with the smithay-clipboard thread in a tight read loop rather than recovering — which is not addressed here and would need a fresh reproduction.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UL2Y1HFGgYbQcyhBsUa3DU