-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make with_parent_window
safe
#3142
base: master
Are you sure you want to change the base?
Conversation
2e66158
to
b3000cf
Compare
This is not an alternative since it doesn't achieve what said PR achieves. However doing something like that is fine. |
bd80244
to
2933b0a
Compare
After looking into it, I don't think it's a good idea as of now to accept owned handler if winit can only provide This update should be a part of the winit safe handles work. |
b3000cf
to
e66eba3
Compare
That should actually be good to go now, right? |
After looking at this a bit more closely, I question how thread safety is achieved here exactly. |
I think this works on platforms with a "main-thread only" concept, unsure about platforms where a handle may be bound to a specific thread (Windows?) My reasoning for main thread only being safe on macOS/iOS:
|
If the only valid thread is the main thread, I agree there is no problem, because Summarizing remaining problems:
|
Alternative to #3136. EDIT: We'd still need some more work to make
Fullscreen
Send + Sync
on all platforms.Builds upon #3126 to remove the
unsafe
fromWindowBuilder::with_parent_window
, by taking the lifetime inherent in that, and extending it on the platforms where it is relevant.TODO:
CHANGELOG.md