fix(linux): position gtk::Fixed child webviews via move_ (honor set_bounds)#1745
Open
ds1 wants to merge 1 commit into
Open
fix(linux): position gtk::Fixed child webviews via move_ (honor set_bounds)#1745ds1 wants to merge 1 commit into
ds1 wants to merge 1 commit into
Conversation
…ounds) Signed-off-by: ds1 <danmakesthings@gmail.com>
This was referenced Jun 2, 2026
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.
What
On Linux,
WebView::set_boundspositions agtk::Fixed-parented webview with a baresize_allocate. That allocation is transient —GtkFixedre-allocates each child to its stored put-coordinate on the next size-allocate, so the requested position is dropped on the first relayout (the webview snaps back to where it was first placed). The size is also not retained as a request.This positions the child via its parent
gtk::Fixed'smove_andset_size_request(which persist across layout passes), keeping the immediatesize_allocate:Why
This is the documented X11 + Wayland multi-webview path —
WebViewBuilderExtUnix::new_gtk/build_gtkover agtk::Fixed(see thegtk_multiwebviewexample). Today,set_boundscalls after the initial layout don't hold: positioned webviews drift back to their original spot on resize/relayout.Context: this is the wry-side half of tauri-apps/tauri#10420 (multi-webview child positioning broken on Linux/GTK). The other half is Tauri packing child webviews into a
gtk::Fixedrather than the window's verticalgtk::Box(proposed in that thread). With agtk::Fixedparent + this change,set_boundsfrom app code positions children correctly and the position survives relayouts.Testing
Applied on top of
wry 0.55.1and run in a Tauri v2 app on WSLg (Ubuntu 22.04, WebKitGTK 2.50.4), with content webviews hosted in agtk::Fixed: webviews now hold their bounds across tab-switch, multi-tab, drawer-resize, and window-resize. Withoutmove_, the position was dropped after the first relayout (reproduced and verified).Notes
Related (not in this PR): on this path
WebView::bounds()doesn't report the child's position (returns(0, 0)), so a read-modify-write of bounds (e.g.set_sizeafterset_position) can clobber the position. Happy to follow up separately.A
.changesentry is included (wry: patch).