Skip to content

Present egui's frame in step with embedded views below it on macOS - #8945

Merged
emilk merged 5 commits into
mainfrom
emilk/present-with-views-below
Nov 25, 2026
Merged

emilk merged 5 commits into
mainfrom
emilk/present-with-views-below

Conversation

@emilk

@emilk emilk commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

A native view below egui's surface (an egui::EmbeddedView, e.g. a WKWebView) moves in a Core Animation transaction. egui's Metal frame was presented outside of it, so the frame that cleared the view's new rect could appear after the view had moved, and the window background showed through the old rect.

This adds egui_wgpu::winit::Painter::set_present_with_transaction, which sets presentsWithTransaction on the Metal layer. eframe turns it on for a viewport while that viewport shows a view below egui's surface, and off again when none is left. Until now egui_webview set the flag on egui's layer from the outside.

It does nothing on other platforms, and it needs the existing macos-window-resize-jitter-fix feature.

  • I have followed the instructions in the PR template

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Preview available at https://egui-pr-preview.github.io/pr/8945-emilkpresent-with-views-below
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

Comment thread crates/egui-wgpu/src/winit.rs Resolved
Comment thread crates/egui-wgpu/src/winit.rs Resolved
@emilk emilk added feature New feature or request egui-wgpu labels Nov 25, 2026
@emilk
emilk marked this pull request as ready for review November 25, 2026 14:21
@emilk
emilk requested a review from Wumpf as a code owner November 25, 2026 14:21
@emilk
emilk enabled auto-merge (squash) November 25, 2026 14:23
auto-merge was automatically disabled November 25, 2026 14:25

Pull Request is not mergeable

emilk added a commit to rerun-io/egui_crates that referenced this pull request Nov 25, 2026
… transaction

eframe now sets `presentsWithTransaction` itself (emilk/egui#8945), so the backend
no longer touches egui's Metal layer. It returns an error if egui doesn't render with Metal.
@emilk
emilk force-pushed the emilk/present-with-views-below branch from 70c78c6 to fd551ea Compare November 25, 2026 14:33
@emilk
emilk merged commit 13e3802 into main Nov 25, 2026
26 checks passed
@emilk
emilk deleted the emilk/present-with-views-below branch November 25, 2026 14:42
emilk added a commit to rerun-io/egui_crates that referenced this pull request Nov 25, 2026
emilk added a commit to rerun-io/egui_crates that referenced this pull request Nov 25, 2026
emilk added a commit to rerun-io/egui_crates that referenced this pull request Nov 25, 2026
… transaction

eframe now sets `presentsWithTransaction` itself (emilk/egui#8945), so the backend
no longer touches egui's Metal layer. It returns an error if egui doesn't render with Metal.
emilk added a commit to rerun-io/egui_crates that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui-wgpu feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant