Repository navigation
Unsloth Desktop: keep the page sized to the window after a fast resize on Windows - #12542
Closed
LeoBorcherding wants to merge 3 commits into
Closed
LeoBorcherding wants to merge 3 commits into
LeoBorcherding wants to merge 3 commits into
Conversation
…size on Windows wry moves the WebView2 container with SWP_ASYNCWINDOWPOS, so a fast drag of the custom resize grips can leave the page at an older size. On Resized and ScaleFactorChanged, re-read the client rect and resize the container and controller synchronously.
Member
Collaborator
Author
|
Closing this since #13255 fixed it. That PR cut the frontend work that was stalling the page while the window was being resized, and the blank strip doesn't show up on a fast drag on main anymore. |
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.
On Windows, dragging the window edge quickly can leave the page stuck at an older size: the window grows, but the titlebar, sidebar and chat stop short, leaving a blank strip on the right and bottom.
Unsloth Desktop draws its own titlebar on Windows, so the native frame is turned off. In that mode wry resizes the WebView2 on
WM_SIZE, but it moves the WebView's container window withSWP_ASYNCWINDOWPOS. During a fast drag, the container can end up behind the window. The page CSS is all sized relative to the viewport, so the stuck piece is the WebView bounds, not the layout.This adds a Windows-only handler for
ResizedandScaleFactorChanged. It re-reads the current client rect and resizes the container and the WebView2 controller to it synchronously. Because it reads the size when it runs instead of trusting the event, a stale event still ends up at the right size. Minimized windows are skipped. There are no frontend changes and nothing changes on macOS or Linux.285d157a41)ad27c1952a)Measured on: PC, Windows 11 build, display scale. Before/after runs and screenshots to follow.
Fast corner and edge drags on the tester PC (Windows 11, RX 5700 XT + RX 6500 XT), release Unsloth Desktop on the left and a shell built from this branch on the right, played at half speed. The release build's page stops short of the window mid-drag and leaves a blank strip; this branch keeps it filled.
Follow-up idea, not in this PR:
transparent: truereportedly cuts the lag during the drag itself (tauri-apps/tauri#13270), but it changes compositing for the whole app.