Skip to content

AppKit: Expose native transition state - #4610

Open
yay wants to merge 2 commits into
rust-windowing:masterfrom
yay:steady/macos-native-transition-state
Open

AppKit: Expose native transition state#4610
yay wants to merge 2 commits into
rust-windowing:masterfrom
yay:steady/macos-native-transition-state

Conversation

@yay

@yay yay commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This exposes AppKit native transition state through WindowExtMacOS:

  • WindowExtMacOS::is_live_resizing() for AppKit live-resize transitions.
  • WindowExtMacOS::is_fullscreen_transition() for native fullscreen enter/exit transitions.

It also keeps macOS maximized state cached so callers can poll Window::is_maximized() without forcing NSWindow.isZoomed to temporarily mutate window style masks, and requests a final redraw when AppKit completes native fullscreen transitions.

Motivation

Renderer integrations need to know when AppKit is driving native window transitions so they can synchronize surface presentation and avoid stale or stretched frames during live resize and fullscreen animations.

For a specific example see this egui PR emilk/egui#8280 that depends on this winit PR.

Checks

  • cargo +nightly fmt --check
  • cargo check -p winit --all-features

Comment thread winit-appkit/src/window_delegate.rs
@yay
yay force-pushed the steady/macos-native-transition-state branch from 67ace9c to 086c209 Compare June 30, 2026 14:31
@yay
yay marked this pull request as ready for review June 30, 2026 15:58
@yay
yay requested a review from madsmtm as a code owner June 30, 2026 15:58
@yay
yay force-pushed the steady/macos-native-transition-state branch from 086c209 to d7af73e Compare July 28, 2026 12:06
@kchibisov

Copy link
Copy Markdown
Member

Hm, I think AppKit has a separate event end point which it calls during live resize. I think other platforms have the same concept of interactive resize, but they tend to deliver event via usual resize mechanism.

I'm just not quite sure why this extra information is only needed on macOS and not on e.g. Wayland for wgpu to work. I do remember this stretching of viewport type of issue though myself in alacritty, and we never bothered to deal with it on macOS.

That being said, can we somehow handle it via regular Resize event? Or maybe exposing some state information along resize to indicate that it's interactive resize or something to solve this problem on macOS, so it'll be done in a cross platform way and users won't have to worry about such thing?

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants