Repository navigation
Release the window when the file chooser's portal goes away - #51
Merged
Merged
Conversation
While the chooser is open, Hype swallows input to its own windows and waits for the portal's response. A portal that exited after accepting the request never sends one, which left the editor locked with no way to close it. Watching the portal's name ends the wait with an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex <noreply@openai.com>
[Medium impact] The PR appears safe to merge; no actionable new issues were found. Summary
Reviews (2) · Last reviewed commit: "Also release the window when the portal ..." · Reviewed by Greptile |
xdg-desktop-portal --replace hands the name straight to the new process, which never unregisters it, and the new process knows nothing of the old request. Any change of owner after the first one now ends the wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex <noreply@openai.com>
Closed
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.
While a desktop file chooser is open,
FileDialog::chooseruns a nested event loop and filters out every key, click and close on Hype's own windows, so nothing changes under an import. It ends the loop on the portal'sResponsesignal or a failed method call. If xdg-desktop-portal exits after accepting the request (a crash, a restart, a session update), or is replaced by another process with--replace, neither arrives: the loop never returns and the editor stays frozen, ignoring even the window's close button.The dialog now watches who owns the portal's name on the session bus for as long as it waits. When the owner leaves or changes, the call returns with "The desktop file chooser closed without answering.", which the editor already shows in its status line like any other chooser error. A first owner appearing, as when the call itself starts the portal, is ignored.
The fake-portal test gains both cases: the portal accepts the request, then drops its name, or another connection takes it over. Without the watcher each hangs. That test only runs with
HYPE_PORTAL_TESTS=1underdbus-run-session, as before, because it claims the portal's name on the bus.No CI runs here yet: master has no workflow until #48 lands, and #48's needs omacom/omarchy-pkgs#2573. Merged onto #48 with that pull request's dependencies, the tests pass.
🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex XHigh.