Skip to content

Improve rendering performance on Windows - #728

Merged
mehmetozguldev merged 3 commits into
athasdev:mainfrom
joordih:fix/windows-performance
Jul 18, 2026
Merged

Improve rendering performance on Windows#728
mehmetozguldev merged 3 commits into
athasdev:mainfrom
joordih:fix/windows-performance

Conversation

@joordih

@joordih joordih commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Windows rendering has been noticeably behind macOS, especially menu and popup transitions. This PR closes most of that gap without changing a single pixel or animation: every change is Windows-gated, macOS and Linux are untouched.

What changed

Opaque main window on Windows (src-tauri/tauri.windows.conf.json, new)
The base config sets transparent: true for every platform, but only macOS uses it (the glass chrome is gated on platform-macos, and configure_app_window already paints the Windows background opaque). WebView2 pays a real cost for transparent windows: the whole surface goes through per-pixel alpha composition and loses GPU fast paths. Windows now gets its own platform config with transparent: false, mirroring how tauri.macos.conf.json already works. Since the window was always painted opaque there, nothing changes visually.

GPU rasterization flags for WebView2 (same file)
additionalBrowserArgs adds --enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist, with Tauri's default Windows args re-included since this field replaces them.

Compositor hints for popup transitions (use-platform-setup.ts, window-transparency.css)
The root element now gets a platform-windows class (Windows previously shared platform-other with Linux, so it couldn't be targeted separately). Menubar and combobox popups get will-change: opacity, transform, filter on Windows: the exact same open/close transitions, but composited on the GPU instead of re-rasterized on the main thread every frame.

Window controls and menu stacking (capabilities/main.json, menubar.tsx)
The custom title bar needs core:window:allow-minimize and core:window:allow-toggle-maximize to work on Windows. Menubar popup positioners get explicit z-index values so menus and submenus stack above the workbench chrome.

Notes

  • No visual or animation changes on any platform.
  • macOS and Linux code paths are byte-identical.
  • tsc --noEmit clean.

@mehmetozguldev
mehmetozguldev self-requested a review July 16, 2026 21:28
joordih added 2 commits July 16, 2026 23:39
Make the main window opaque on Windows so WebView2 leaves the per-pixel
alpha composition path. The window is already painted opaque there, so
nothing changes visually while compositing gets the GPU fast paths back.

Enable GPU rasterization flags for the webview and promote the menubar
and combobox popups to their own compositor layer with a platform-windows
root class, keeping their open/close transitions identical but composited
on the GPU instead of re-rasterized on the main thread.
Grant the window capabilities the custom title bar needs to minimize and
toggle-maximize on Windows, and give the menubar popup positioners explicit
z-index values so menus and submenus stack above the workbench chrome.
@joordih
joordih force-pushed the fix/windows-performance branch from 3b42247 to 66f5f88 Compare July 16, 2026 21:42
@mehmetozguldev

Copy link
Copy Markdown
Member

I appreciate the PR! I'll test the changes on Windows now and hopefully merge after that. Code looks clean

Keep the opaque Windows window and compositor hints without shipping WebView2
diagnostic GPU flags that bypass hardware safeguards. Make platform classes
exclusive and grant the remaining window menu capabilities with regression
coverage for the runtime configuration.

Copy link
Copy Markdown
Member

Thanks again. I pushed a follow-up that keeps the opaque Windows window while removing production GPU override flags, makes platform classes exclusive, completes the window menu capabilities, and adds regression coverage.

@mehmetozguldev
mehmetozguldev merged commit 4363820 into athasdev:main Jul 18, 2026
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.

2 participants