fix(macos): keep webview synced during window zoom - #1207
Open
Tunglies wants to merge 2 commits into
Open
Conversation
Tunglies
commented
Apr 27, 2026
| && curr_mask.contains(NSWindowStyleMask::Titled) | ||
| { | ||
| // Just use the native zoom if resizable | ||
| ns_window.zoom(None); |
Contributor
Author
There was a problem hiding this comment.
This may be more than a patch-level change. Fixing the animation behavior requires removing the use of
ns_window.zoom(None) so AppKit no longer takes over the zoom animation path.
Contributor
Package Changes Through 9883397There are 1 changes which include tao with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
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.
Related issues:
tauri-apps/tauri#13898
tauri-apps/tauri#14288
tauri-apps/tauri#15092
Possible related issues(not tested):
tauri-apps/tauri#14843
tauri-apps/tauri#5226
The
ns_window.zoom(None)path is used for normal macOS windows because Tao previously called itwhenever the window was both
ResizableandTitled. That means most regular Tauri windows usedAppKit's native smart-zoom implementation for
set_maximized.The problem is that
NSWindow::zoomperforms an internal AppKit zoom animation instead of resizing thewindow through Tao's own frame path. During that animation, the
NSWindowframe can advance before theembedded
WKWebView's native bounds and JavaScript viewport are updated. As a result, WebView contenttemporarily stays at the old size while the window has already grown, which shows up as white/blank
borders or delayed content resizing during maximize/restore.
The same issue can also be triggered by titlebar double-click, because AppKit invokes the same native
zoom behavior there. Therefore the fix avoids
ns_window.zoom(None)for maximize and interceptswindowShouldZoom:toFrame:so titlebar zoom also goes through Tao's controlled maximize path.Basline
record-before.mov
With PR
record-after.mov