-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
DS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)DS - webAffects the Web backend (WebAssembly/WASM)Affects the Web backend (WebAssembly/WASM)F - 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
EventLoopProxyalways!Sync - Make
EventLoopProxySyncon macOS by wrapping its internals in a mutex - Make
EventLoopProxyalways!Sync, but create a platform-specificSyncEventLoopProxytype which is likeEventLoopProxybutSync, and whichEventLoopProxycan be converted into through a platform specific-API - Create a non-default feature flag which makes
EventLoopProxySyncand document that that feature flag can only be enabled on certain platforms
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)DS - webAffects the Web backend (WebAssembly/WASM)Affects the Web backend (WebAssembly/WASM)F - questionThere's no such thing as a stupid oneThere's no such thing as a stupid oneS - apiDesign and usabilityDesign and usability