Repository navigation
Conversation
A window shown on behalf of another application (a desktop portal file or application chooser, for example) must be parented to that application's toplevel, which only exists as an exported xdg-foreign handle, and may carry a startup activation token. Add `window::open_dialog(handle, modal, settings)`, `window::open_dialog_with_activation(handle, modal, token, settings)` and `Action::OpenDialog`. The `winit` shell passes the handle, modal hint and token through `Control::CreateWindow` and applies them with winit's Wayland `with_foreign_parent` and `with_activation_token` attributes before the first commit. The task resolves to `Some(id)` once the window is open. The open channel becomes an `OpenResponse` carrying either kind of sender. Known gap: on non-Wayland backends the dialog currently opens as an unparented window rather than resolving to `None`. Requires winit's `WindowAttributesExtWayland::with_foreign_parent`; `Cargo.toml` patches winit to the fork commit that provides it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Canopa fork tracking PR. Its diff against
canopa/base(595af03, the tip of upstream's0.14branch wheniced_widget0.14.2 was released.iced_winitandiced_runtimethere are identical to the 0.14.0 release,3997291) is exactly the change Canopa carries iniced_winit/iced_runtime. It is merged intocanopa/main, which Canopa builds. This PR stays open until the change is upstreamed or dropped.What
iced_runtime:window::open_dialog(handle, modal, settings),window::open_dialog_with_activation(handle, modal, token, settings)andAction::OpenDialog. The handle is an xdg-foreign handle without thewayland:prefix.iced_winit:Control::CreateWindowcarries the handle, modal hint and optional activation token, andtransient::dialog_attributesapplies them with winit's Waylandwith_foreign_parentandwith_activation_tokenbefore the first commit. The task yieldsSome(id)once open.OpenResponse(Normal/Transient). This branch is independent ofcanopa/open-transient, which adds the same enum, so each PR pins exactly one winit topic.canopa/maincontains the combined version.winit pin: the root
Cargo.tomladds[patch.crates-io] winit = { git = "https://github.com/kevinard/winit", rev = "021f33898bc9…" }, pointing at kevinard/winitcanopa/wayland-foreign-parent(import a foreign parent and dialog hint before the initial configure).Cargo.lockis updated to match.canopa/mainpins winit'scanopa/maininstead.Why
Canopa's FileChooser and AppChooser portal backends run Iced dialogs on behalf of other applications. Those dialogs must be parented, and optionally modal, to the caller's exported toplevel, and must use the incoming activation token. See Canopa ADR 0026 and 0028.
Verification
cargo check --locked --all-targets -p iced_winit -p iced_runtime -p iced_test(default features) andcargo check --locked -p iced --no-default-features --features advanced,wgpu,crisp,web-colors,thread-pool,wayland,image(Canopa's selection) pass at this branch. The only warning is the pre-existingf32::INFINITYdeprecation iniced_widget.cargo test --locked -p iced_winit -p iced_runtime --libpasses.Upstream
Upstream it, together with xdg-foreign support in winit (none upstream). Known gap to fix first: on non-Wayland backends
OpenDialogopens an unparented window instead of returningNoneas documented. The[patch.crates-io]pin is fork-only and goes away once winit provides the API.🤖 Generated with Claude Code