-
-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that OS/X window creation is done in the main thread #47
Comments
For the moment I think that we should call |
I'm not even sure that you can't bypass the restrictions. |
We need to create some bindings with the GCD framework to execute code on the main thread. You can assign me for this task. |
@DavidPartouche will https://github.com/SSheldon/rust-dispatch enable us to do this? |
@SSheldon In my opinion we should just detect whether we're in the main thread when creating a window, and panic if it's not the case. Ultimately the main window constructor should do the same check, whatever the platform is. |
@tomaka there's also an issue that we can't poll for events on multiple threads; that should probably just be handled by the main thread.
I think that, with the current event iterators, another window's iterator might receive your event and then it doesn't know what to do with it. This could potentially be solved by the main thread polling for events and then dispatching them to the appropriate window. That's where my suggestion of a |
Closing in favor of rust-windowing/winit#31 |
Either fail if not on the main thread, or redirect the creation to the main thread somehow. The second solution is preferred.
cc #4
The text was updated successfully, but these errors were encountered: