Use an unique window class name per winit version
This uses an unique window class name per winit version and checks for errors when registering class names to avoid unsafety.
Fixes https://github.com/rust-windowing/winit/issues/3132
Having multiple instances of winit in the same application is not really supported.
Can you explain why you're hitting this issue? Maybe including CARGO_PKG_VERSION in the default name would be the better fix?
In any case, I do agree that we should do the error handling better.
It's easy to end up with multiple different winit versions due to frequent incompatible releases, that's how I noticed the issue.
CARGO_PKG_VERSION is not guaranteed to be unique, unlike static addresses.
Hmm, I guess I just don't see how you'd end up with running two versions of winit in the same binary?
I'm running puffin_egui in a separate thread from the main GUI app.
The event loop window class had the same issue, so I've changed that too.
Yeah. I get multiple windows with multiple winit versions instead of a crash.