mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
Refactor usage of CFRunLoopObserver (#4349)
Added a common interface that: - Uses closures instead of static functions. This should allow easier refactoring in the future. - Returns a handle which is invalidated on `Drop`. This should avoid situations where the event loop has exited, but an observer is still called because the user spawned the application later on. - Is properly main-thread safe. This interface is placed in winit-common, to allow using it in both winit-appkit and winit-uikit.
This commit is contained in:
@@ -18,7 +18,7 @@ x11 = ["xkbcommon-dl?/x11", "dep:x11-dl"]
|
||||
xkb = ["dep:xkbcommon-dl", "dep:smol_str"]
|
||||
|
||||
# CoreFoundation
|
||||
core-foundation = ["dep:objc2", "dep:objc2-core-foundation"]
|
||||
core-foundation = ["dep:block2", "dep:objc2", "dep:objc2-core-foundation"]
|
||||
|
||||
[dependencies]
|
||||
smol_str = { workspace = true, optional = true }
|
||||
@@ -31,9 +31,12 @@ x11-dl = { workspace = true, optional = true }
|
||||
xkbcommon-dl = { workspace = true, optional = true }
|
||||
|
||||
# CoreFoundation
|
||||
block2 = { workspace = true, optional = true }
|
||||
objc2 = { workspace = true, optional = true }
|
||||
objc2-core-foundation = { workspace = true, optional = true, features = [
|
||||
"std",
|
||||
"block2",
|
||||
"objc2",
|
||||
"CFRunLoop",
|
||||
"CFString",
|
||||
] }
|
||||
|
||||
Reference in New Issue
Block a user