-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
DS - iosDS - macosDS - webF - questionThere's no such thing as a stupid oneThere's no such thing as a stupid oneS - apiDesign and usabilityDesign and usability
Description
Hi all, thank you for your consideration. Someone previously created #3220 on this subject, but then closed their own issue when they found that there actually is an obstacle to making EventLoopProxy
Sync
on macOS. However, I'm creating this issue for further discussion because I think it is unfortunate that the API is as such.
EventLoopProxy
being Sync
only on non-macOS platforms makes it so that one can write code with winit that doesn't seem to be using any platform-specific features but nonetheless fails to compile on macOS while compiling fine on other platforms, which I think goes against winit's generally very nice goals and behaviors in terms of cross-platform abstraction.
Some possible ways I can imagine dealing with this include:
- Make
EventLoopProxy
always!Sync
- Make
EventLoopProxy
Sync
on macOS by wrapping its internals in a mutex - Make
EventLoopProxy
always!Sync
, but create a platform-specificSyncEventLoopProxy
type which is likeEventLoopProxy
butSync
, and whichEventLoopProxy
can be converted into through a platform specific-API - Create a non-default feature flag which makes
EventLoopProxy
Sync
and document that that feature flag can only be enabled on certain platforms
Metadata
Metadata
Assignees
Labels
DS - iosDS - macosDS - webF - questionThere's no such thing as a stupid oneThere's no such thing as a stupid oneS - apiDesign and usabilityDesign and usability