fix(desktop): keep WebView2 scale correct after restore / 修复 Windows 混合 DPI 恢复缩放 - #6472
Merged
SivanCola merged 2 commits intoJul 14, 2026
Merged
Conversation
This was referenced Jul 14, 2026
4 tasks
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.
Summary
go-webview2v1.0.23, with the upstream source, license, patch rationale, and removal condition documented.Root cause: Windows temporarily parks minimized windows off-screen. On mixed-DPI desktops this can associate the frameless window with another monitor, while Wails v2 suppresses the minimize-time WebView resize and disables WebView2's automatic monitor-scale detection. The stale rasterization scale and bounds then survive restore until another resize occurs.
This follows the upstream Wails diagnosis in wailsapp/wails#5544 and the monitor-scale ownership fix in wailsapp/wails#5734 without removing Reasonix's Windows frameless chrome.
Verification
cd desktop && go test ./...cd desktop && wails generate module(no generated diff)cd desktop/third_party/go-webview2 && GOOS=windows GOARCH=amd64 go test -exec=true ./pkg/edgecd desktop/third_party/go-webview2 && GOOS=windows GOARCH=arm64 go test -exec=true ./pkg/edgecd desktop && GOOS=windows GOARCH=amd64 go build -trimpath .cd desktop && GOOS=windows GOARCH=arm64 go build -trimpath .github.com/wailsapp/go-webview2 => ./third_party/go-webview2in their Go build metadata../scripts/cache-guard.shPhysical mixed-DPI Windows hardware was not available locally. The policy matches the upstream fix verified for the same minimize/restore DPI failure mode.
Compatibility
Cache impact
Cache-impact: none - the change is limited to Windows desktop WebView2 initialization and does not affect provider-visible prompts, tool schemas, ordering, or request serialization.
Cache-guard:
./scripts/cache-guard.shpassed all release cache-hit cases.System-prompt-review: N/A