Repository navigation
Conversation
There is no way to open a window attached to an existing one (for example a floating preview or a non-modal dialog). Setting the parent after creation is too late on Wayland: a tiling compositor sizes the window from its first configure, before the parent is known. Add `window::open_transient(parent, settings)` and `Action::OpenTransient`. The `winit` shell passes the parent's native window through `Control::CreateWindow` and sets it with winit's Wayland `with_transient_parent` attribute before the first commit. The task resolves to `Some(id)` once the window is open, or `None` when the parent is gone or the backend cannot parent windows (currently anything but Wayland), in which case no window is shown. To report this, the open channel becomes an `OpenResponse` carrying either kind of sender. Requires winit's `WindowAttributesExtWayland::with_transient_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_transient(parent, settings) -> (Id, Task<Option<Id>>)andAction::OpenTransient.iced_winit:Control::CreateWindowcarries the parent's native window, andtransient::attributesapplies it with winit's Waylandwith_transient_parentbefore the first commit. The task yieldsSome(id)when the window opens. It yieldsNonewhen the parent is gone or the backend cannot parent windows (anything other than Wayland), and then no window is shown.OpenResponse(Normal/Transient).winit pin: the root
Cargo.tomladds[patch.crates-io] winit = { git = "https://github.com/kevinard/winit", rev = "99f9e76c37b5…" }, pointing at kevinard/winitcanopa/wayland-transient-parent(set a transient parent before the initial configure).Cargo.lockis updated to match.canopa/mainpins winit'scanopa/maininstead.Why
Canopa Files opens a floating Quick Look attached to its Browser window, at the requested size. The parent must be known before the first configure, or tiling compositors keep the tiled size. See Canopa ADR 0019.
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. iced master still uses winit 0.30.13, and winit has no Wayland parent yet: issue rust-windowing/winit#4256 and PR rust-windowing/winit#4627 are open. The
[patch.crates-io]pin is fork-only and goes away once winit provides the API.🤖 Generated with Claude Code