# Patched lan-mouse — forward accelerated pointer deltas ## Why Upstream lan-mouse 0.11.0 (`input-capture/src/layer_shell.rs`) captures pointer motion from `zwp_relative_pointer_v1` and forwards the **unaccelerated** deltas: ```rust dx_unaccel: dx, dy_unaccel: dy, .. ``` The `..` discards the accelerated `dx`/`dy` carried in the same event. The receiving end emulates through `wlr-virtual-pointer`, which is not a libinput device and therefore applies no acceleration curve of its own. Net effect: the sender's acceleration curve is stripped in transit and nothing replaces it, so the pointer is far too fast on the remote machine. Critically, this also means `sensitivity` / `accel_profile` are inert for forwarded motion on **both** ends — the receiver because a virtual pointer isn't a libinput device, the sender because unaccelerated deltas bypass the curve by definition. There is no configuration fix; that is why this patch exists. ## What the patch does 1. Forwards the accelerated `dx`/`dy` instead. This restores the sending machine's curve, and makes the sender's `sensitivity`/`accel_profile` actually control how the remote pointer feels. 2. Adds `LAN_MOUSE_POINTER_SCALE` (float, default `1.0`) as a multiplier, for the residual difference in logical pixel density between the two screens. Unset = upstream scaling. ## Rebuild ```sh git clone https://github.com/feschber/lan-mouse.git cd lan-mouse git checkout 0d2190e787db9e482e17d4c16fb7c00ef4841bcb # == Arch extra 0.11.0-1 git apply ~/.local/share/lan-mouse-patched/accelerated-deltas.patch CARGO_PROFILE_RELEASE_LTO=false CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16 \ cargo build --release --locked --no-default-features \ --features layer_shell_capture,wlroots_emulation install -m755 target/release/lan-mouse ~/.local/bin/lan-mouse-patched systemctl --user restart lan-mouse ``` Build deps: `rust` (installed from Arch `extra`). GTK is deliberately excluded — the daemon does not need the GUI, and the signed package at `/usr/bin/lan-mouse` still provides it. ## Install layout - Patched daemon: `~/.local/bin/lan-mouse-patched` (named so it cannot shadow `lan-mouse` on PATH) - Unit: `~/.config/systemd/user/lan-mouse.service` -> `ExecStart` points at the patched binary - The signed Arch package stays installed and untouched; no pacman divergence, no `IgnorePkg`. - Cert/config path is unchanged (`~/.config/lan-mouse/`), so the DTLS fingerprint is unchanged and the peer's `[authorized_fingerprints]` still matches. ## Upstreaming Worth reporting to https://github.com/feschber/lan-mouse — the unaccel choice is defensible when the receiver applies its own acceleration, but no Wayland emulation backend in lan-mouse does.