Skip to content

Update to winit 0.30#9089

Merged
Wumpf merged 4 commits intogfx-rs:trunkfrom
cwfitzgerald:cw/winit-0.30
Mar 18, 2026
Merged

Update to winit 0.30#9089
Wumpf merged 4 commits intogfx-rs:trunkfrom
cwfitzgerald:cw/winit-0.30

Conversation

@cwfitzgerald
Copy link
Copy Markdown
Member

@cwfitzgerald cwfitzgerald commented Feb 21, 2026

Connections

Closes #5214
Closes #5722
Closes #8155

Description

This moves us entirely over to winit 0.30. This is not amazingly reviewable due to a lot of code needing to move around, but it is mainly just moving things around. If you want to review it, I would look at the new files directly.

Testing

Manual testing across platforms and on the web.

Squash or Rebase?

I think this needs to be squashed, unfortunately.

@inner-daemons inner-daemons self-requested a review February 21, 2026 18:34
@cwfitzgerald cwfitzgerald marked this pull request as ready for review February 22, 2026 02:05
@inner-daemons inner-daemons self-assigned this Feb 25, 2026
@emilk
Copy link
Copy Markdown
Contributor

emilk commented Mar 6, 2026

FWIW: I gave this PR a spin just to see if it affects #8309, but on my computer this PR makes no difference.

@inner-daemons
Copy link
Copy Markdown
Collaborator

@cwfitzgerald This probably warrants a copilot gh review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repo to use winit 0.30 (and related ecosystem updates like glutin), and refactors examples/tools to the ApplicationHandler + resumed() window creation model required by winit 0.30.

Changes:

  • Bump winit to 0.30.x and update glutin/glutin-winit, removing temporary raw-window-handle 0.5 compatibility.
  • Refactor native + wasm examples to ApplicationHandler/run_app (and spawn_app on web), moving window creation into resumed().
  • Update dependency-policy configuration (.deny.toml) to reflect the new dependency graph.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Cargo.toml Bumps winit to 0.30.8 and updates glutin/glutin-winit versions.
Cargo.lock Locks updated dependency graph for the new winit/glutin versions.
.deny.toml Adjusts cargo-deny skip rules for new transitive versions.
wgpu-hal/Cargo.toml Removes rwh_05 compatibility deps and adjusts platform cfgs for the raw-gles example.
wgpu-hal/examples/raw-gles.rs Migrates raw GLES example to ApplicationHandler and rwh 0.6 handle APIs.
wgpu-hal/examples/halmark/main.rs Migrates example to ApplicationHandler and creates window in resumed().
wgpu-hal/examples/ray-traced-triangle/main.rs Migrates example to ApplicationHandler and creates window in resumed().
player/src/bin/play.rs Updates winit integration and window/surface creation flow for 0.30.
examples/features/src/framework.rs Refactors shared example framework to ApplicationHandler + async init via user events.
examples/features/src/hello_triangle/mod.rs Refactors hello-triangle to ApplicationHandler + async init via user events.
examples/features/src/hello_windows/mod.rs Refactors hello-windows multi-window example to ApplicationHandler.
examples/features/src/uniform_values/mod.rs Refactors uniform-values example to ApplicationHandler + async init via user events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cwfitzgerald
Copy link
Copy Markdown
Member Author

Unfortunately still pretty useless

@inner-daemons
Copy link
Copy Markdown
Collaborator

Sea levels rose 0.1m so copilot could read this and leave no comments.

Copy link
Copy Markdown
Collaborator

@inner-daemons inner-daemons left a comment

Choose a reason for hiding this comment

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

Logic is duplicated a lot, so I didn't leave the same comments in 5 places. But many of my comments on hello_triangle or other files also apply to hello_windows, uniform_values, and the other examples.

let display_handle = event_loop.owned_display_handle();
let proxy = self.proxy.clone();

spawn(async move {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe add a comment saying that this doesn't spawn anything on native


impl ApplicationHandler<TriangleAction> for App {
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
if !matches!(self.state, AppState::Uninitialized) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

framework.rs uses surface.resume(context, window.clone(), E::SRGB); here which is a fix for android I think. This skips that?

@junglie85
Copy link
Copy Markdown
Contributor

winit 0.31.0-beta.2 is the current version on main.

Some notable changes - there are likely more:

  • Window is now a trait object.
  • EventLoop and EventLoopProxy do not take any generic arguments.
  • ActiveEventLoop is now a trait object.
  • ApplicationHandler trait:
    • introduces can_create_surface method.
    • user_event is replaced with proxy_wake_up and channels.

Given that this PR is a large change, and the move to 0.31 is likely going to be another large change in a different direction, would it be wise to skip 0.30 and go straight to supporting 0.31?

@cwfitzgerald
Copy link
Copy Markdown
Member Author

cwfitzgerald commented Mar 13, 2026

I'd rather land this incrementally - from your list the diff won't be too bad from 0.30 -> 0.31 and this had to completely restructure the examples.

@inner-daemons
Copy link
Copy Markdown
Collaborator

@Wumpf would be nice to get the examples working with winit 0.30 before the next release, if you have time.

@inner-daemons inner-daemons requested a review from Wumpf March 14, 2026 02:52
@cwfitzgerald cwfitzgerald force-pushed the cw/winit-0.30 branch 4 times, most recently from aa6cda3 to 507a3e1 Compare March 18, 2026 17:14
Copy link
Copy Markdown
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

reviewed it in person on a call

@Wumpf Wumpf merged commit 2810e95 into gfx-rs:trunk Mar 18, 2026
58 checks passed
@cwfitzgerald cwfitzgerald deleted the cw/winit-0.30 branch March 18, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants