Skip to content

Update to winit 0.30 - #61

Closed
stefnotch wants to merge 2 commits into
rukai:mainfrom
stefnotch:main
Closed

Update to winit 0.30#61
stefnotch wants to merge 2 commits into
rukai:mainfrom
stefnotch:main

Conversation

@stefnotch

@stefnotch stefnotch commented May 6, 2024

Copy link
Copy Markdown

Overhauls the public API to support winit 0.30

One thing to note is that I moved the "update" logic from AboutToWait to RedrawRequested.
This isn't optimal, as it doesn't call update if there is no redrawing. So a hello world app that never triggers a redraw would also not respond to quit events and such.

Using AboutToWait comes with a different issue https://docs.rs/winit/latest/winit/application/trait.ApplicationHandler.html#method.about_to_wait

I'm not entirely sure what the best option here is.

@stefnotch

Copy link
Copy Markdown
Author

Maybe I should trigger a request redraw whenever a potentially relevant event happens?
After all, winit will take all those redraw requests and only schedule as many as actually needed.

@hakolao

hakolao commented Jun 4, 2024

Copy link
Copy Markdown

Is there a way to make this without having to wrap under application handler? Just updating state with events... Kind of like it used to be. Is there something preventing that?

I'm not too fond of the winit's new api, but also i've not yet attempted to update my libs so haven't formed a full opinion.

@stefnotch

stefnotch commented Jun 4, 2024

Copy link
Copy Markdown
Author

Yes, that's possible. The downside would be that it'd be the user's responsibility to call a winit-input-helper method in 3 places: window_event, in device_event and in suspended.

But I suppose even with that downside, such an API would be worthwhile to have.

@rukai rukai mentioned this pull request Sep 18, 2025
@rukai

rukai commented Sep 18, 2025

Copy link
Copy Markdown
Owner

Many thanks for your work on this, I have completed the move to winit 0.30.0 here: #68

@rukai rukai closed this Sep 18, 2025
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.

3 participants