Skip to content

fix(macos): keep webview synced during window zoom - #1207

Open
Tunglies wants to merge 2 commits into
tauri-apps:devfrom
Tunglies:fix-macos-sync-resizing
Open

fix(macos): keep webview synced during window zoom#1207
Tunglies wants to merge 2 commits into
tauri-apps:devfrom
Tunglies:fix-macos-sync-resizing

Conversation

@Tunglies

@Tunglies Tunglies commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

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 it
whenever the window was both Resizable and Titled. That means most regular Tauri windows used
AppKit's native smart-zoom implementation for set_maximized.

The problem is that NSWindow::zoom performs an internal AppKit zoom animation instead of resizing the
window through Tao's own frame path. During that animation, the NSWindow frame can advance before the
embedded WKWebView's native bounds and JavaScript viewport are updated. As a result, WebView content
temporarily 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 intercepts
windowShouldZoom:toFrame: so titlebar zoom also goes through Tao's controlled maximize path.


Basline

record-before.mov

With PR

record-after.mov

@Tunglies
Tunglies requested a review from a team as a code owner April 27, 2026 11:04
&& curr_mask.contains(NSWindowStyleMask::Titled)
{
// Just use the native zoom if resizable
ns_window.zoom(None);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 9883397

There are 1 changes which include tao with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.35.0 0.35.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant