rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.88k stars 911 forks source link

Make Windows main thread checks more forgiving #4003

Open PJB3005 opened 5 days ago

PJB3005 commented 5 days ago

The check on Windows to enforce that the event loop is created from the main thread is not fully reliable (https://github.com/rust-windowing/winit/issues/3999). Given that this check is not necessary on Windows and only exists more as an assert to enforce platform consistency in development, I have made it more lax:

Fixes #3999

PJB3005 commented 5 days ago

Any idea how we'd go about checking that?

PJB3005 commented 4 days ago

Alright, I figured out a way to check it, hope this is sufficient.

notgull commented 3 days ago

I would rather use a better way to detect if we are on the main thread, if possible. I've opened #4006 for this. Let me know if it works.