mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
update dependencies (#302)
* update dependencies * update windows * clippy: inline format args * update flake * update core-graphics * fix poll after completion error * fix ashpd?!
This commit is contained in:
committed by
GitHub
parent
9f10ebcbd2
commit
eb1dcbddb0
2055
Cargo.lock
generated
2055
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@@ -24,7 +24,7 @@ strip = true
|
|||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
shadow-rs = "0.38.0"
|
shadow-rs = "1.2.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
input-event = { path = "input-event", version = "0.3.0" }
|
input-event = { path = "input-event", version = "0.3.0" }
|
||||||
@@ -34,9 +34,9 @@ lan-mouse-cli = { path = "lan-mouse-cli", version = "0.2.0" }
|
|||||||
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.2.0", optional = true }
|
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.2.0", optional = true }
|
||||||
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.2.0" }
|
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.2.0" }
|
||||||
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.2.0" }
|
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.2.0" }
|
||||||
shadow-rs = { version = "0.38.0", features = ["metadata"] }
|
shadow-rs = { version = "1.2.0", features = ["metadata"] }
|
||||||
|
|
||||||
hickory-resolver = "0.24.1"
|
hickory-resolver = "0.25.2"
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
log = "0.4.20"
|
log = "0.4.20"
|
||||||
@@ -58,8 +58,8 @@ slab = "0.4.9"
|
|||||||
thiserror = "2.0.0"
|
thiserror = "2.0.0"
|
||||||
tokio-util = "0.7.11"
|
tokio-util = "0.7.11"
|
||||||
local-channel = "0.1.5"
|
local-channel = "0.1.5"
|
||||||
webrtc-dtls = { version = "0.10.0", features = ["pem"] }
|
webrtc-dtls = { version = "0.12.0", features = ["pem"] }
|
||||||
webrtc-util = "0.9.0"
|
webrtc-util = "0.11.0"
|
||||||
rustls = { version = "0.23.12", default-features = false, features = [
|
rustls = { version = "0.23.12", default-features = false, features = [
|
||||||
"std",
|
"std",
|
||||||
"ring",
|
"ring",
|
||||||
|
|||||||
12
flake.lock
generated
12
flake.lock
generated
@@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740560979,
|
"lastModified": 1752687322,
|
||||||
"narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
|
"narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5135c59491985879812717f4c9fea69604e7f26f",
|
"rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -29,11 +29,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740623427,
|
"lastModified": 1752806774,
|
||||||
"narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=",
|
"narHash": "sha256-4cHeoR2roN7d/3J6gT+l6o7J2hTrBIUiCwVdDNMeXzE=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab",
|
"rev": "3c90219b3ba1c9790c45a078eae121de48a39c55",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -40,21 +40,21 @@ wayland-protocols-wlr = { version = "0.3.1", features = [
|
|||||||
"client",
|
"client",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
|
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
|
||||||
ashpd = { version = "0.10", default-features = false, features = [
|
ashpd = { version = "0.11.0", default-features = false, features = [
|
||||||
"tokio",
|
"tokio",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
reis = { version = "0.4", features = ["tokio"], optional = true }
|
reis = { version = "0.5.0", features = ["tokio"], optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="macos")'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
core-graphics = { version = "0.24.0", features = ["highsierra"] }
|
core-graphics = { version = "0.25.0", features = ["highsierra"] }
|
||||||
core-foundation = "0.10.0"
|
core-foundation = "0.10.0"
|
||||||
core-foundation-sys = "0.8.6"
|
core-foundation-sys = "0.8.6"
|
||||||
libc = "0.2.155"
|
libc = "0.2.155"
|
||||||
keycode = "0.4.0"
|
keycode = "1.0.0"
|
||||||
bitflags = "2.6.0"
|
bitflags = "2.6.0"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
windows = { version = "0.58.0", features = [
|
windows = { version = "0.61.2", features = [
|
||||||
"Win32_System_LibraryLoader",
|
"Win32_System_LibraryLoader",
|
||||||
"Win32_System_Threading",
|
"Win32_System_Threading",
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ impl State {
|
|||||||
fn update_windows(&mut self) {
|
fn update_windows(&mut self) {
|
||||||
log::info!("active outputs: ");
|
log::info!("active outputs: ");
|
||||||
for output in self.outputs.iter().filter(|o| o.info.is_some()) {
|
for output in self.outputs.iter().filter(|o| o.info.is_some()) {
|
||||||
log::info!(" * {}", output);
|
log::info!(" * {output}");
|
||||||
}
|
}
|
||||||
|
|
||||||
self.active_windows.clear();
|
self.active_windows.clear();
|
||||||
@@ -582,17 +582,17 @@ impl Inner {
|
|||||||
match self.queue.dispatch_pending(&mut self.state) {
|
match self.queue.dispatch_pending(&mut self.state) {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(DispatchError::Backend(WaylandError::Io(e))) => {
|
Err(DispatchError::Backend(WaylandError::Io(e))) => {
|
||||||
log::error!("Wayland Error: {}", e);
|
log::error!("Wayland Error: {e}");
|
||||||
}
|
}
|
||||||
Err(DispatchError::Backend(e)) => {
|
Err(DispatchError::Backend(e)) => {
|
||||||
panic!("backend error: {}", e);
|
panic!("backend error: {e}");
|
||||||
}
|
}
|
||||||
Err(DispatchError::BadMessage {
|
Err(DispatchError::BadMessage {
|
||||||
sender_id,
|
sender_id,
|
||||||
interface,
|
interface,
|
||||||
opcode,
|
opcode,
|
||||||
}) => {
|
}) => {
|
||||||
panic!("bad message {}, {} , {}", sender_id, interface, opcode);
|
panic!("bad message {sender_id}, {interface} , {opcode}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -974,7 +974,7 @@ impl Dispatch<ZxdgOutputV1, u32> for State {
|
|||||||
.find(|o| o.global.name == *name)
|
.find(|o| o.global.name == *name)
|
||||||
.expect("output");
|
.expect("output");
|
||||||
|
|
||||||
log::debug!("xdg_output {name} - {:?}", event);
|
log::debug!("xdg_output {name} - {event:?}");
|
||||||
match event {
|
match event {
|
||||||
zxdg_output_v1::Event::LogicalPosition { x, y } => {
|
zxdg_output_v1::Event::LogicalPosition { x, y } => {
|
||||||
output.pending_info.position = (x, y);
|
output.pending_info.position = (x, y);
|
||||||
@@ -1010,7 +1010,7 @@ impl Dispatch<WlOutput, u32> for State {
|
|||||||
_conn: &Connection,
|
_conn: &Connection,
|
||||||
_qhandle: &QueueHandle<Self>,
|
_qhandle: &QueueHandle<Self>,
|
||||||
) {
|
) {
|
||||||
log::debug!("wl_output {name} - {:?}", event);
|
log::debug!("wl_output {name} - {event:?}");
|
||||||
if let wl_output::Event::Done = event {
|
if let wl_output::Event::Done = event {
|
||||||
state.update_output_info(*name);
|
state.update_output_info(*name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ impl Display for Position {
|
|||||||
Position::Top => "top",
|
Position::Top => "top",
|
||||||
Position::Bottom => "bottom",
|
Position::Bottom => "bottom",
|
||||||
};
|
};
|
||||||
write!(f, "{}", pos)
|
write!(f, "{pos}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -587,9 +587,13 @@ impl LanMouseInputCapture for LibeiInputCapture<'_> {
|
|||||||
self.cancellation_token.cancel();
|
self.cancellation_token.cancel();
|
||||||
let task = &mut self.capture_task;
|
let task = &mut self.capture_task;
|
||||||
log::debug!("waiting for capture to terminate...");
|
log::debug!("waiting for capture to terminate...");
|
||||||
let res = task.await.expect("libei task panic");
|
let res = if !task.is_finished() {
|
||||||
log::debug!("done!");
|
task.await.expect("libei task panic")
|
||||||
|
} else {
|
||||||
|
Ok(())
|
||||||
|
};
|
||||||
self.terminated = true;
|
self.terminated = true;
|
||||||
|
log::debug!("done!");
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use core_graphics::base::{kCGErrorSuccess, CGError};
|
|||||||
use core_graphics::display::{CGDisplay, CGPoint};
|
use core_graphics::display::{CGDisplay, CGPoint};
|
||||||
use core_graphics::event::{
|
use core_graphics::event::{
|
||||||
CGEvent, CGEventFlags, CGEventTap, CGEventTapLocation, CGEventTapOptions, CGEventTapPlacement,
|
CGEvent, CGEventFlags, CGEventTap, CGEventTapLocation, CGEventTapOptions, CGEventTapPlacement,
|
||||||
CGEventTapProxy, CGEventType, EventField,
|
CGEventTapProxy, CGEventType, CallbackResult, EventField,
|
||||||
};
|
};
|
||||||
use core_graphics::event_source::{CGEventSource, CGEventSourceStateID};
|
use core_graphics::event_source::{CGEventSource, CGEventSourceStateID};
|
||||||
use futures_core::Stream;
|
use futures_core::Stream;
|
||||||
@@ -394,11 +394,11 @@ fn create_event_tap<'a>(
|
|||||||
// may already be closed when the InputCapture instance is dropped.
|
// may already be closed when the InputCapture instance is dropped.
|
||||||
let _ = event_tx.blocking_send((pos, *e));
|
let _ = event_tx.blocking_send((pos, *e));
|
||||||
});
|
});
|
||||||
// Returning None should stop the event from being processed
|
// Returning Drop should stop the event from being processed
|
||||||
// but core fundation still returns the event
|
// but core fundation still returns the event
|
||||||
cg_ev.set_type(CGEventType::Null);
|
cg_ev.set_type(CGEventType::Null);
|
||||||
}
|
}
|
||||||
Some(cg_ev.to_owned())
|
CallbackResult::Replace(cg_ev.to_owned())
|
||||||
};
|
};
|
||||||
|
|
||||||
let tap = CGEventTap::new(
|
let tap = CGEventTap::new(
|
||||||
@@ -411,7 +411,7 @@ fn create_event_tap<'a>(
|
|||||||
.map_err(|_| MacosCaptureCreationError::EventTapCreation)?;
|
.map_err(|_| MacosCaptureCreationError::EventTapCreation)?;
|
||||||
|
|
||||||
let tap_source: CFRunLoopSource = tap
|
let tap_source: CFRunLoopSource = tap
|
||||||
.mach_port
|
.mach_port()
|
||||||
.create_runloop_source(0)
|
.create_runloop_source(0)
|
||||||
.expect("Failed creating loop source");
|
.expect("Failed creating loop source");
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use std::thread;
|
|||||||
use tokio::sync::mpsc::error::TrySendError;
|
use tokio::sync::mpsc::error::TrySendError;
|
||||||
use tokio::sync::mpsc::Sender;
|
use tokio::sync::mpsc::Sender;
|
||||||
use windows::core::{w, PCWSTR};
|
use windows::core::{w, PCWSTR};
|
||||||
use windows::Win32::Foundation::{FALSE, HINSTANCE, HWND, LPARAM, LRESULT, RECT, WPARAM};
|
use windows::Win32::Foundation::{FALSE, HWND, LPARAM, LRESULT, RECT, WPARAM};
|
||||||
use windows::Win32::Graphics::Gdi::{
|
use windows::Win32::Graphics::Gdi::{
|
||||||
EnumDisplayDevicesW, EnumDisplaySettingsW, DEVMODEW, DISPLAY_DEVICEW,
|
EnumDisplayDevicesW, EnumDisplaySettingsW, DEVMODEW, DISPLAY_DEVICEW,
|
||||||
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP, ENUM_CURRENT_SETTINGS,
|
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP, ENUM_CURRENT_SETTINGS,
|
||||||
@@ -19,12 +19,12 @@ use windows::Win32::System::Threading::GetCurrentThreadId;
|
|||||||
|
|
||||||
use windows::Win32::UI::WindowsAndMessaging::{
|
use windows::Win32::UI::WindowsAndMessaging::{
|
||||||
CallNextHookEx, CreateWindowExW, DispatchMessageW, GetMessageW, PostThreadMessageW,
|
CallNextHookEx, CreateWindowExW, DispatchMessageW, GetMessageW, PostThreadMessageW,
|
||||||
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HHOOK,
|
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HOOKPROC,
|
||||||
HMENU, HOOKPROC, KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL,
|
KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL, WH_MOUSE_LL,
|
||||||
WH_MOUSE_LL, WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN,
|
WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN, WM_LBUTTONUP,
|
||||||
WM_LBUTTONUP, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOUSEWHEEL,
|
WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_RBUTTONDOWN,
|
||||||
WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN,
|
WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN, WM_XBUTTONUP, WNDCLASSW,
|
||||||
WM_XBUTTONUP, WNDCLASSW, WNDPROC,
|
WNDPROC,
|
||||||
};
|
};
|
||||||
|
|
||||||
use input_event::{
|
use input_event::{
|
||||||
@@ -128,7 +128,7 @@ thread_local! {
|
|||||||
fn get_msg() -> Option<MSG> {
|
fn get_msg() -> Option<MSG> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut msg = std::mem::zeroed();
|
let mut msg = std::mem::zeroed();
|
||||||
let ret = GetMessageW(addr_of_mut!(msg), HWND::default(), 0, 0);
|
let ret = GetMessageW(addr_of_mut!(msg), None, 0, 0);
|
||||||
match ret.0 {
|
match ret.0 {
|
||||||
0 => None,
|
0 => None,
|
||||||
x if x > 0 => Some(msg),
|
x if x > 0 => Some(msg),
|
||||||
@@ -176,14 +176,15 @@ fn start_routine(
|
|||||||
|
|
||||||
/* register hooks */
|
/* register hooks */
|
||||||
unsafe {
|
unsafe {
|
||||||
let _ = SetWindowsHookExW(WH_MOUSE_LL, mouse_proc, HINSTANCE::default(), 0).unwrap();
|
let _ = SetWindowsHookExW(WH_MOUSE_LL, mouse_proc, None, 0).unwrap();
|
||||||
let _ = SetWindowsHookExW(WH_KEYBOARD_LL, kybrd_proc, HINSTANCE::default(), 0).unwrap();
|
let _ = SetWindowsHookExW(WH_KEYBOARD_LL, kybrd_proc, None, 0).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let instance = unsafe { GetModuleHandleW(None).unwrap() };
|
let instance = unsafe { GetModuleHandleW(None).unwrap() };
|
||||||
|
let instance = instance.into();
|
||||||
let window_class: WNDCLASSW = WNDCLASSW {
|
let window_class: WNDCLASSW = WNDCLASSW {
|
||||||
lpfnWndProc: window_proc,
|
lpfnWndProc: window_proc,
|
||||||
hInstance: instance.into(),
|
hInstance: instance,
|
||||||
lpszClassName: w!("lan-mouse-message-window-class"),
|
lpszClassName: w!("lan-mouse-message-window-class"),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
@@ -213,9 +214,9 @@ fn start_routine(
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
HWND::default(),
|
None,
|
||||||
HMENU::default(),
|
None,
|
||||||
instance,
|
Some(instance),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
.expect("CreateWindowExW");
|
.expect("CreateWindowExW");
|
||||||
@@ -312,7 +313,7 @@ unsafe extern "system" fn mouse_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM)
|
|||||||
|
|
||||||
/* no client was active */
|
/* no client was active */
|
||||||
if !active {
|
if !active {
|
||||||
return CallNextHookEx(HHOOK::default(), ncode, wparam, lparam);
|
return CallNextHookEx(None, ncode, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get active client if any */
|
/* get active client if any */
|
||||||
@@ -337,7 +338,7 @@ unsafe extern "system" fn mouse_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM)
|
|||||||
unsafe extern "system" fn kybrd_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
|
unsafe extern "system" fn kybrd_proc(ncode: i32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
|
||||||
/* get active client if any */
|
/* get active client if any */
|
||||||
let Some(client) = ACTIVE_CLIENT.get() else {
|
let Some(client) = ACTIVE_CLIENT.get() else {
|
||||||
return CallNextHookEx(HHOOK::default(), ncode, wparam, lparam);
|
return CallNextHookEx(None, ncode, wparam, lparam);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* convert to key event */
|
/* convert to key event */
|
||||||
@@ -388,7 +389,10 @@ fn enumerate_displays(display_rects: &mut Vec<RECT>) {
|
|||||||
if ret == FALSE {
|
if ret == FALSE {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP != 0 {
|
if device
|
||||||
|
.StateFlags
|
||||||
|
.contains(DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
|
||||||
|
{
|
||||||
devices.push(device.DeviceName);
|
devices.push(device.DeviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,18 +39,18 @@ wayland-protocols-misc = { version = "0.3.1", features = [
|
|||||||
"client",
|
"client",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
|
x11 = { version = "2.21.0", features = ["xlib", "xtest"], optional = true }
|
||||||
ashpd = { version = "0.10", default-features = false, features = [
|
ashpd = { version = "0.11.0", default-features = false, features = [
|
||||||
"tokio",
|
"tokio",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
reis = { version = "0.4", features = ["tokio"], optional = true }
|
reis = { version = "0.5.0", features = ["tokio"], optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="macos")'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
bitflags = "2.6.0"
|
bitflags = "2.6.0"
|
||||||
core-graphics = { version = "0.24.0", features = ["highsierra"] }
|
core-graphics = { version = "0.25.0", features = ["highsierra"] }
|
||||||
keycode = "0.4.0"
|
keycode = "1.0.0"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
windows = { version = "0.58.0", features = [
|
windows = { version = "0.61.2", features = [
|
||||||
"Win32_System_LibraryLoader",
|
"Win32_System_LibraryLoader",
|
||||||
"Win32_System_Threading",
|
"Win32_System_Threading",
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
|
|||||||
@@ -161,12 +161,12 @@ fn get_display_at_point(x: CGFloat, y: CGFloat) -> Option<CGDirectDisplayID> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if error != 0 {
|
if error != 0 {
|
||||||
log::warn!("error getting displays at point ({}, {}): {}", x, y, error);
|
log::warn!("error getting displays at point ({x}, {y}): {error}");
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
if display_count == 0 {
|
if display_count == 0 {
|
||||||
log::debug!("no displays found at point ({}, {})", x, y);
|
log::debug!("no displays found at point ({x}, {y})");
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,13 +163,13 @@ impl Emulation for WlrootsEmulation {
|
|||||||
async fn create(&mut self, handle: EmulationHandle) {
|
async fn create(&mut self, handle: EmulationHandle) {
|
||||||
self.state.add_client(handle);
|
self.state.add_client(handle);
|
||||||
if let Err(e) = self.queue.flush() {
|
if let Err(e) = self.queue.flush() {
|
||||||
log::error!("{}", e);
|
log::error!("{e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async fn destroy(&mut self, handle: EmulationHandle) {
|
async fn destroy(&mut self, handle: EmulationHandle) {
|
||||||
self.state.destroy_client(handle);
|
self.state.destroy_client(handle);
|
||||||
if let Err(e) = self.queue.flush() {
|
if let Err(e) = self.queue.flush() {
|
||||||
log::error!("{}", e);
|
log::error!("{e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async fn terminate(&mut self) {
|
async fn terminate(&mut self) {
|
||||||
@@ -221,7 +221,7 @@ impl VirtualInput {
|
|||||||
self.keyboard.key(time, key, state as u32);
|
self.keyboard.key(time, key, state as u32);
|
||||||
if let Ok(mut mods) = self.modifiers.lock() {
|
if let Ok(mut mods) = self.modifiers.lock() {
|
||||||
if mods.update_by_key_event(key, state) {
|
if mods.update_by_key_event(key, state) {
|
||||||
log::trace!("Key triggers modifier change: {:?}", mods);
|
log::trace!("Key triggers modifier change: {mods:?}");
|
||||||
self.keyboard.modifiers(
|
self.keyboard.modifiers(
|
||||||
mods.mask_pressed().bits(),
|
mods.mask_pressed().bits(),
|
||||||
0,
|
0,
|
||||||
@@ -330,7 +330,7 @@ impl XMods {
|
|||||||
|
|
||||||
fn update_by_key_event(&mut self, key: u32, state: u8) -> bool {
|
fn update_by_key_event(&mut self, key: u32, state: u8) -> bool {
|
||||||
if let Ok(key) = scancode::Linux::try_from(key) {
|
if let Ok(key) = scancode::Linux::try_from(key) {
|
||||||
log::trace!("Attempting to process modifier from: {:#?}", key);
|
log::trace!("Attempting to process modifier from: {key:#?}");
|
||||||
let pressed_mask = match key {
|
let pressed_mask = match key {
|
||||||
scancode::Linux::KeyLeftShift | scancode::Linux::KeyRightShift => XMods::ShiftMask,
|
scancode::Linux::KeyLeftShift | scancode::Linux::KeyRightShift => XMods::ShiftMask,
|
||||||
scancode::Linux::KeyLeftCtrl | scancode::Linux::KeyRightCtrl => XMods::ControlMask,
|
scancode::Linux::KeyLeftCtrl | scancode::Linux::KeyRightCtrl => XMods::ControlMask,
|
||||||
@@ -348,7 +348,7 @@ impl XMods {
|
|||||||
|
|
||||||
// unchanged
|
// unchanged
|
||||||
if pressed_mask.is_empty() && locked_mask.is_empty() {
|
if pressed_mask.is_empty() && locked_mask.is_empty() {
|
||||||
log::trace!("{:#?} is not a modifier key", key);
|
log::trace!("{key:#?} is not a modifier key");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
match state {
|
match state {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
thiserror = "2.0.0"
|
thiserror = "2.0.0"
|
||||||
|
|
||||||
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
||||||
reis = { version = "0.4", optional = true }
|
reis = { version = "0.5.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["libei"]
|
default = ["libei"]
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ impl Display for KeyboardEvent {
|
|||||||
impl Display for Event {
|
impl Display for Event {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Event::Pointer(p) => write!(f, "{}", p),
|
Event::Pointer(p) => write!(f, "{p}"),
|
||||||
Event::Keyboard(k) => write!(f, "{}", k),
|
Event::Keyboard(k) => write!(f, "{k}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ impl Window {
|
|||||||
|
|
||||||
pub(super) fn update_client_config(&self, handle: ClientHandle, client: ClientConfig) {
|
pub(super) fn update_client_config(&self, handle: ClientHandle, client: ClientConfig) {
|
||||||
let Some(row) = self.row_for_handle(handle) else {
|
let Some(row) = self.row_for_handle(handle) else {
|
||||||
log::warn!("could not find row for handle {}", handle);
|
log::warn!("could not find row for handle {handle}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
row.set_hostname(client.hostname);
|
row.set_hostname(client.hostname);
|
||||||
@@ -334,11 +334,11 @@ impl Window {
|
|||||||
|
|
||||||
pub(super) fn update_client_state(&self, handle: ClientHandle, state: ClientState) {
|
pub(super) fn update_client_state(&self, handle: ClientHandle, state: ClientState) {
|
||||||
let Some(row) = self.row_for_handle(handle) else {
|
let Some(row) = self.row_for_handle(handle) else {
|
||||||
log::warn!("could not find row for handle {}", handle);
|
log::warn!("could not find row for handle {handle}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let Some(client_object) = self.client_object_for_handle(handle) else {
|
let Some(client_object) = self.client_object_for_handle(handle) else {
|
||||||
log::warn!("could not find row for handle {}", handle);
|
log::warn!("could not find row for handle {handle}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ impl AsyncFrontendListener {
|
|||||||
let (socket_path, listener) = {
|
let (socket_path, listener) = {
|
||||||
let socket_path = crate::default_socket_path()?;
|
let socket_path = crate::default_socket_path()?;
|
||||||
|
|
||||||
log::debug!("remove socket: {:?}", socket_path);
|
log::debug!("remove socket: {socket_path:?}");
|
||||||
if socket_path.exists() {
|
if socket_path.exists() {
|
||||||
// try to connect to see if some other instance
|
// try to connect to see if some other instance
|
||||||
// of lan-mouse is already running
|
// of lan-mouse is already running
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::{collections::HashMap, net::IpAddr};
|
|||||||
use local_channel::mpsc::{channel, Receiver, Sender};
|
use local_channel::mpsc::{channel, Receiver, Sender};
|
||||||
use tokio::task::{spawn_local, JoinHandle};
|
use tokio::task::{spawn_local, JoinHandle};
|
||||||
|
|
||||||
use hickory_resolver::{error::ResolveError, TokioAsyncResolver};
|
use hickory_resolver::{ResolveError, TokioResolver};
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
use lan_mouse_ipc::ClientHandle;
|
use lan_mouse_ipc::ClientHandle;
|
||||||
@@ -26,7 +26,7 @@ pub(crate) enum DnsEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct DnsTask {
|
struct DnsTask {
|
||||||
resolver: TokioAsyncResolver,
|
resolver: TokioResolver,
|
||||||
request_rx: Receiver<DnsRequest>,
|
request_rx: Receiver<DnsRequest>,
|
||||||
event_tx: Sender<DnsEvent>,
|
event_tx: Sender<DnsEvent>,
|
||||||
cancellation_token: CancellationToken,
|
cancellation_token: CancellationToken,
|
||||||
@@ -35,7 +35,7 @@ struct DnsTask {
|
|||||||
|
|
||||||
impl DnsResolver {
|
impl DnsResolver {
|
||||||
pub(crate) fn new() -> Result<Self, ResolveError> {
|
pub(crate) fn new() -> Result<Self, ResolveError> {
|
||||||
let resolver = TokioAsyncResolver::tokio_from_system_conf()?;
|
let resolver = TokioResolver::builder_tokio()?.build();
|
||||||
let (request_tx, request_rx) = channel();
|
let (request_tx, request_rx) = channel();
|
||||||
let (event_tx, event_rx) = channel();
|
let (event_tx, event_rx) = channel();
|
||||||
let cancellation_token = CancellationToken::new();
|
let cancellation_token = CancellationToken::new();
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ async fn read_loop(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log::info!("dtls client disconnected {:?}", addr);
|
log::info!("dtls client disconnected {addr:?}");
|
||||||
let mut conns = conns.lock().await;
|
let mut conns = conns.lock().await;
|
||||||
let index = conns
|
let index = conns
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use crate::{
|
|||||||
listen::{LanMouseListener, ListenerCreationError},
|
listen::{LanMouseListener, ListenerCreationError},
|
||||||
};
|
};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use hickory_resolver::error::ResolveError;
|
use hickory_resolver::ResolveError;
|
||||||
use lan_mouse_ipc::{
|
use lan_mouse_ipc::{
|
||||||
AsyncFrontendListener, ClientConfig, ClientHandle, ClientState, FrontendEvent, FrontendRequest,
|
AsyncFrontendListener, ClientConfig, ClientHandle, ClientState, FrontendEvent, FrontendRequest,
|
||||||
IpcError, IpcListenerCreationError, Position, Status,
|
IpcError, IpcListenerCreationError, Position, Status,
|
||||||
|
|||||||
Reference in New Issue
Block a user