Skip to content

Commit b6b2f1a

Browse files
committed
Updating dependencies + fix macos warning.
1 parent 4532c6e commit b6b2f1a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ serialize = ["serde"]
2222
unstable_grab = ["evdev-rs", "epoll", "inotify"]
2323

2424
[target.'cfg(target_os = "macos")'.dependencies]
25-
cocoa = "0.22"
26-
core-graphics = {version = "0.19.0", features = ["highsierra"]}
27-
core-foundation = {version = "0.7"}
28-
core-foundation-sys = {version = "0.7"}
25+
cocoa = "0.26"
26+
core-graphics = {version = "0.24.0", features = ["highsierra"]}
27+
core-foundation = {version = "0.10"}
28+
core-foundation-sys = {version = "0.8"}
2929

3030

3131
[target.'cfg(target_os = "linux")'.dependencies]
3232
libc = "0.2"
3333
x11 = {version = "2.18", features = ["xlib", "xrecord", "xinput"]}
34-
evdev-rs = {version = "0.4.0", optional=true}
34+
evdev-rs = {version = "0.6", optional=true}
3535
epoll = {version = "4.1.0", optional=true}
36-
inotify = {version = "0.8.2", default-features=false, optional=true}
36+
inotify = {version = "0.11", default-features=false, optional=true}
3737

3838
[target.'cfg(target_os = "windows")'.dependencies]
3939
winapi = { version = "0.3", features = ["winuser", "errhandlingapi", "processthreadsapi"] }
@@ -43,7 +43,7 @@ serde_json = "1.0"
4343
# Some tests interact with the real OS. We can't hit the OS in parallel
4444
# because that leads to unexpected behavior and flaky tests, so we need
4545
# to run thoses tests in sequence instead.
46-
serial_test = "0.4"
46+
serial_test = "3"
4747
tokio = {version = "1.5", features=["sync", "macros", "rt-multi-thread"]}
4848

4949
[[example]]

src/macos/listen.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ unsafe extern "C" fn raw_callback(
2222
let opt = KEYBOARD_STATE.lock();
2323
if let Ok(mut keyboard) = opt {
2424
if let Some(event) = convert(_type, &cg_event, &mut keyboard) {
25-
if let Some(callback) = &mut GLOBAL_CALLBACK {
25+
// Reborrowing the global callback pointer.
26+
// Totally UB. but not sure there's a great alternative.
27+
let ptr = &raw mut GLOBAL_CALLBACK;
28+
if let Some(callback) = &mut *ptr {
2629
callback(event);
2730
}
2831
}

0 commit comments

Comments
 (0)