Skip to content

Commit eb1dcbd

Browse files
authored
update dependencies (#302)
* update dependencies * update windows * clippy: inline format args * update flake * update core-graphics * fix poll after completion error * fix ashpd?!
1 parent 9f10ebc commit eb1dcbd

File tree

19 files changed

+1163
-1026
lines changed

19 files changed

+1163
-1026
lines changed

Cargo.lock

Lines changed: 1085 additions & 956 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ strip = true
2424
panic = "abort"
2525

2626
[build-dependencies]
27-
shadow-rs = "0.38.0"
27+
shadow-rs = "1.2.0"
2828

2929
[dependencies]
3030
input-event = { path = "input-event", version = "0.3.0" }
@@ -34,9 +34,9 @@ lan-mouse-cli = { path = "lan-mouse-cli", version = "0.2.0" }
3434
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.2.0", optional = true }
3535
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.2.0" }
3636
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.2.0" }
37-
shadow-rs = { version = "0.38.0", features = ["metadata"] }
37+
shadow-rs = { version = "1.2.0", features = ["metadata"] }
3838

39-
hickory-resolver = "0.24.1"
39+
hickory-resolver = "0.25.2"
4040
toml = "0.8"
4141
serde = { version = "1.0", features = ["derive"] }
4242
log = "0.4.20"
@@ -58,8 +58,8 @@ slab = "0.4.9"
5858
thiserror = "2.0.0"
5959
tokio-util = "0.7.11"
6060
local-channel = "0.1.5"
61-
webrtc-dtls = { version = "0.10.0", features = ["pem"] }
62-
webrtc-util = "0.9.0"
61+
webrtc-dtls = { version = "0.12.0", features = ["pem"] }
62+
webrtc-util = "0.11.0"
6363
rustls = { version = "0.23.12", default-features = false, features = [
6464
"std",
6565
"ring",

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

input-capture/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ wayland-protocols-wlr = { version = "0.3.1", features = [
4040
"client",
4141
], optional = true }
4242
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
43-
ashpd = { version = "0.10", default-features = false, features = [
43+
ashpd = { version = "0.11.0", default-features = false, features = [
4444
"tokio",
4545
], optional = true }
46-
reis = { version = "0.4", features = ["tokio"], optional = true }
46+
reis = { version = "0.5.0", features = ["tokio"], optional = true }
4747

4848
[target.'cfg(target_os="macos")'.dependencies]
49-
core-graphics = { version = "0.24.0", features = ["highsierra"] }
49+
core-graphics = { version = "0.25.0", features = ["highsierra"] }
5050
core-foundation = "0.10.0"
5151
core-foundation-sys = "0.8.6"
5252
libc = "0.2.155"
53-
keycode = "0.4.0"
53+
keycode = "1.0.0"
5454
bitflags = "2.6.0"
5555

5656
[target.'cfg(windows)'.dependencies]
57-
windows = { version = "0.58.0", features = [
57+
windows = { version = "0.61.2", features = [
5858
"Win32_System_LibraryLoader",
5959
"Win32_System_Threading",
6060
"Win32_Foundation",

input-capture/src/layer_shell.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ impl State {
535535
fn update_windows(&mut self) {
536536
log::info!("active outputs: ");
537537
for output in self.outputs.iter().filter(|o| o.info.is_some()) {
538-
log::info!(" * {}", output);
538+
log::info!(" * {output}");
539539
}
540540

541541
self.active_windows.clear();
@@ -582,17 +582,17 @@ impl Inner {
582582
match self.queue.dispatch_pending(&mut self.state) {
583583
Ok(_) => {}
584584
Err(DispatchError::Backend(WaylandError::Io(e))) => {
585-
log::error!("Wayland Error: {}", e);
585+
log::error!("Wayland Error: {e}");
586586
}
587587
Err(DispatchError::Backend(e)) => {
588-
panic!("backend error: {}", e);
588+
panic!("backend error: {e}");
589589
}
590590
Err(DispatchError::BadMessage {
591591
sender_id,
592592
interface,
593593
opcode,
594594
}) => {
595-
panic!("bad message {}, {} , {}", sender_id, interface, opcode);
595+
panic!("bad message {sender_id}, {interface} , {opcode}");
596596
}
597597
}
598598
}
@@ -974,7 +974,7 @@ impl Dispatch<ZxdgOutputV1, u32> for State {
974974
.find(|o| o.global.name == *name)
975975
.expect("output");
976976

977-
log::debug!("xdg_output {name} - {:?}", event);
977+
log::debug!("xdg_output {name} - {event:?}");
978978
match event {
979979
zxdg_output_v1::Event::LogicalPosition { x, y } => {
980980
output.pending_info.position = (x, y);
@@ -1010,7 +1010,7 @@ impl Dispatch<WlOutput, u32> for State {
10101010
_conn: &Connection,
10111011
_qhandle: &QueueHandle<Self>,
10121012
) {
1013-
log::debug!("wl_output {name} - {:?}", event);
1013+
log::debug!("wl_output {name} - {event:?}");
10141014
if let wl_output::Event::Done = event {
10151015
state.update_output_info(*name);
10161016
}

input-capture/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl Display for Position {
7979
Position::Top => "top",
8080
Position::Bottom => "bottom",
8181
};
82-
write!(f, "{}", pos)
82+
write!(f, "{pos}")
8383
}
8484
}
8585

input-capture/src/libei.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,13 @@ impl LanMouseInputCapture for LibeiInputCapture<'_> {
587587
self.cancellation_token.cancel();
588588
let task = &mut self.capture_task;
589589
log::debug!("waiting for capture to terminate...");
590-
let res = task.await.expect("libei task panic");
591-
log::debug!("done!");
590+
let res = if !task.is_finished() {
591+
task.await.expect("libei task panic")
592+
} else {
593+
Ok(())
594+
};
592595
self.terminated = true;
596+
log::debug!("done!");
593597
res
594598
}
595599
}

input-capture/src/macos.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use core_graphics::base::{kCGErrorSuccess, CGError};
1010
use core_graphics::display::{CGDisplay, CGPoint};
1111
use core_graphics::event::{
1212
CGEvent, CGEventFlags, CGEventTap, CGEventTapLocation, CGEventTapOptions, CGEventTapPlacement,
13-
CGEventTapProxy, CGEventType, EventField,
13+
CGEventTapProxy, CGEventType, CallbackResult, EventField,
1414
};
1515
use core_graphics::event_source::{CGEventSource, CGEventSourceStateID};
1616
use futures_core::Stream;
@@ -394,11 +394,11 @@ fn create_event_tap<'a>(
394394
// may already be closed when the InputCapture instance is dropped.
395395
let _ = event_tx.blocking_send((pos, *e));
396396
});
397-
// Returning None should stop the event from being processed
397+
// Returning Drop should stop the event from being processed
398398
// but core fundation still returns the event
399399
cg_ev.set_type(CGEventType::Null);
400400
}
401-
Some(cg_ev.to_owned())
401+
CallbackResult::Replace(cg_ev.to_owned())
402402
};
403403

404404
let tap = CGEventTap::new(
@@ -411,7 +411,7 @@ fn create_event_tap<'a>(
411411
.map_err(|_| MacosCaptureCreationError::EventTapCreation)?;
412412

413413
let tap_source: CFRunLoopSource = tap
414-
.mach_port
414+
.mach_port()
415415
.create_runloop_source(0)
416416
.expect("Failed creating loop source");
417417

input-capture/src/windows/event_thread.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::thread;
99
use tokio::sync::mpsc::error::TrySendError;
1010
use tokio::sync::mpsc::Sender;
1111
use windows::core::{w, PCWSTR};
12-
use windows::Win32::Foundation::{FALSE, HINSTANCE, HWND, LPARAM, LRESULT, RECT, WPARAM};
12+
use windows::Win32::Foundation::{FALSE, HWND, LPARAM, LRESULT, RECT, WPARAM};
1313
use windows::Win32::Graphics::Gdi::{
1414
EnumDisplayDevicesW, EnumDisplaySettingsW, DEVMODEW, DISPLAY_DEVICEW,
1515
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP, ENUM_CURRENT_SETTINGS,
@@ -19,12 +19,12 @@ use windows::Win32::System::Threading::GetCurrentThreadId;
1919

2020
use windows::Win32::UI::WindowsAndMessaging::{
2121
CallNextHookEx, CreateWindowExW, DispatchMessageW, GetMessageW, PostThreadMessageW,
22-
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HHOOK,
23-
HMENU, HOOKPROC, KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL,
24-
WH_MOUSE_LL, WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN,
25-
WM_LBUTTONUP, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOUSEWHEEL,
26-
WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN,
27-
WM_XBUTTONUP, WNDCLASSW, WNDPROC,
22+
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HOOKPROC,
23+
KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL, WH_MOUSE_LL,
24+
WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN, WM_LBUTTONUP,
25+
WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_RBUTTONDOWN,
26+
WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN, WM_XBUTTONUP, WNDCLASSW,
27+
WNDPROC,
2828
};
2929

3030
use input_event::{
@@ -128,7 +128,7 @@ thread_local! {
128128
fn get_msg() -> Option<MSG> {
129129
unsafe {
130130
let mut msg = std::mem::zeroed();
131-
let ret = GetMessageW(addr_of_mut!(msg), HWND::default(), 0, 0);
131+
let ret = GetMessageW(addr_of_mut!(msg), None, 0, 0);
132132
match ret.0 {
133133
0 => None,
134134
x if x > 0 => Some(msg),
@@ -176,14 +176,15 @@ fn start_routine(
176176

177177
/* register hooks */
178178
unsafe {
179-
let _ = SetWindowsHookExW(WH_MOUSE_LL, mouse_proc, HINSTANCE::default(), 0).unwrap();
180-
let _ = SetWindowsHookExW(WH_KEYBOARD_LL, kybrd_proc, HINSTANCE::default(), 0).unwrap();
179+
let _ = SetWindowsHookExW(WH_MOUSE_LL, mouse_proc, None, 0).unwrap();
180+
let _ = SetWindowsHookExW(WH_KEYBOARD_LL, kybrd_proc, None, 0).unwrap();
181181
}
182182

183183
let instance = unsafe { GetModuleHandleW(None).unwrap() };
184+
let instance = instance.into();
184185
let window_class: WNDCLASSW = WNDCLASSW {
185186
lpfnWndProc: window_proc,
186-
hInstance: instance.into(),
187+
hInstance: instance,
187188
lpszClassName: w!("lan-mouse-message-window-class"),
188189
..Default::default()
189190
};
@@ -213,9 +214,9 @@ fn start_routine(
213214
0,
214215
0,
215216
0,
216-
HWND::default(),
217-
HMENU::default(),
218-
instance,
217+
None,
218+
None,
219+
Some(instance),
219220
None,
220221
)
221222
.expect("CreateWindowExW");
@@ -312,7 +313,7 @@ unsafe extern "system" fn mouse_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM)
312313

313314
/* no client was active */
314315
if !active {
315-
return CallNextHookEx(HHOOK::default(), ncode, wparam, lparam);
316+
return CallNextHookEx(None, ncode, wparam, lparam);
316317
}
317318

318319
/* get active client if any */
@@ -337,7 +338,7 @@ unsafe extern "system" fn mouse_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM)
337338
unsafe extern "system" fn kybrd_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
338339
/* get active client if any */
339340
let Some(client) = ACTIVE_CLIENT.get() else {
340-
return CallNextHookEx(HHOOK::default(), ncode, wparam, lparam);
341+
return CallNextHookEx(None, ncode, wparam, lparam);
341342
};
342343

343344
/* convert to key event */
@@ -388,7 +389,10 @@ fn enumerate_displays(display_rects: &mut Vec<RECT>) {
388389
if ret == FALSE {
389390
break;
390391
}
391-
if device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP != 0 {
392+
if device
393+
.StateFlags
394+
.contains(DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
395+
{
392396
devices.push(device.DeviceName);
393397
}
394398
}

input-emulation/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ wayland-protocols-misc = { version = "0.3.1", features = [
3939
"client",
4040
], optional = true }
4141
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
42-
ashpd = { version = "0.10", default-features = false, features = [
42+
ashpd = { version = "0.11.0", default-features = false, features = [
4343
"tokio",
4444
], optional = true }
45-
reis = { version = "0.4", features = ["tokio"], optional = true }
45+
reis = { version = "0.5.0", features = ["tokio"], optional = true }
4646

4747
[target.'cfg(target_os="macos")'.dependencies]
4848
bitflags = "2.6.0"
49-
core-graphics = { version = "0.24.0", features = ["highsierra"] }
50-
keycode = "0.4.0"
49+
core-graphics = { version = "0.25.0", features = ["highsierra"] }
50+
keycode = "1.0.0"
5151

5252
[target.'cfg(windows)'.dependencies]
53-
windows = { version = "0.58.0", features = [
53+
windows = { version = "0.61.2", features = [
5454
"Win32_System_LibraryLoader",
5555
"Win32_System_Threading",
5656
"Win32_Foundation",

0 commit comments

Comments
 (0)