winit
winit copied to clipboard
iOS calling `Window::request_redraw()` inside `WindowEvent::RedrawRequested`
Calling Window::request_redraw() inside WindowEvent::RedrawRequested currently panics on iOS.
We should not only not panic, but also correctly schedule the next WindowEvent::RedrawRequested.
This is related to #2412.
I think I'm hitting the same issue on iOS. The event loop is not progressing. When callling request_redraw on the RedrawRequested, no other events are progressed afterwards.
Any update on this? When I try to run an application on ios, I cannot seem to get request_redraw to trigger RedrawRequested repeatedly.
for anyone experiencing the same issue as me - ios not doing anything with request_redraw calls while handling a request redraw event, this was my solution: call request_redraw inside about_to_wait instead! I only was able to learn about this because of https://github.com/bevyengine/bevy/pull/11245. This would be super helpful to mention somewhere in the documentation!
it's clearly a bug that must be fixed though, and IIRC it's kind of fixed now @madsmtm ?
Experiencing the exact same issue, calling request_redraw() in any case besides WindowEvent::RedrawRequested seems to work.
about_to_wait does not seem to run at 60 FPS, on the other hand.
@evrimoztamur Someone was able to suggest a workaround here that worked great for me!
https://github.com/rust-windowing/winit/issues/4204
Thanks! I'm using that right now, but I still wonder why there's platform-inconsistent behavior right now.
I can only assume this aspect of iOS may not have been anticipated in the original design. Hopefully eventually there is a uniform API 🙏