<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lan-mouse/src, branch main</title>
<subtitle>a fork</subtitle>
<id>https://git.nsrddyn.com/lan-mouse/atom/src?h=main</id>
<link rel='self' href='https://git.nsrddyn.com/lan-mouse/atom/src?h=main'/>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/'/>
<updated>2026-11-27T18:08:11Z</updated>
<entry>
<title>Fix capture/emulation bugs, smoother pointer, matching edge positions</title>
<updated>2026-11-27T18:08:11Z</updated>
<author>
<name>nasr</name>
<email>nsrddyn@gmail.com</email>
</author>
<published>2026-11-27T17:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=c994f85a6d743a7600a9013561e43e2206c5b485'/>
<id>urn:sha1:c994f85a6d743a7600a9013561e43e2206c5b485</id>
<content type='text'>
- proto: Enter/Leave carry an optional offset along the crossed edge
  (trailing bytes, so 0.11 peers still interoperate); decode only the
  received bytes instead of a stale fixed buffer; truncated datagrams
  are errors instead of panics
- capture: the cursor enters the remote at the height it left, and
  returns via a locked-pointer cursor hint where it left the remote
- capture: input captured before the peer acks Enter is queued and
  flushed instead of dropped
- layer-shell: forward accelerated motion (virtual pointers are not
  accelerated by the receiving compositor); track the wl_keyboard so
  capabilities events don't duplicate key events; ungrab before
  destroying capture windows; no panics on events without focus
- input-capture: events for positions without a client no longer
  stall the stream (Poll::Pending without a wakeup)
- wlroots emulation: place the cursor on the entry edge via absolute
  motion; drain compositor events and apply keymap changes; send
  axis_source before axis with a single frame
- emulation: check for dead peers every 500ms so held keys are
  released within ~1.5s instead of up to 6s
- connect: stop the ping loop after a send error

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_018U4KzBtfgSJ9kb2ywxrpvG
</content>
</entry>
<entry>
<title>feat: single-instance application support</title>
<updated>2026-09-23T07:41:46Z</updated>
<author>
<name>Ty Smith</name>
<email>ty@tysmith.me</email>
</author>
<published>2026-03-29T01:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=5e9d4c7cea3732463184ca119a60519d885713f1'/>
<id>urn:sha1:5e9d4c7cea3732463184ca119a60519d885713f1</id>
<content type='text'>
Previously, every launch of lan-mouse in GUI mode unconditionally
spawned a new daemon child process and created a new GTK window, even
if an instance was already running. The daemon had single-instance
detection (via IPC socket binding), but the GUI layer did not take
advantage of it.

This change makes the full application single-instance:

- main.rs: Before spawning a daemon child process, probe the IPC
  socket via is_service_running(). If a daemon is already listening,
  skip spawning and just launch the GTK frontend, which connects to
  the existing daemon. Daemon lifecycle cleanup (SIGINT + wait + kill)
  is only performed if we spawned the daemon ourselves.

- lan-mouse-ipc: Add is_service_running() that does a one-shot
  socket probe (Unix socket or TCP on Windows) to check if a daemon
  is reachable. Add try_connect() that attempts a single connection
  without the infinite retry loop of connect()/wait_for_service().
  Extract shared connection-building logic into make_connection().

- lan-mouse-gtk: In build_ui(), check app.active_window() first and
  present the existing window on GApplication re-activation instead
  of creating a duplicate window with a new IPC connection. Replace
  the blocking connect() call with try_connect(), falling back to
  spawning a new daemon and then using connect() if the initial
  connection fails. This handles the edge case where a daemon dies
  between the main.rs probe and the GTK connection attempt.

Behavior changes to note:
- When connecting to an externally-managed daemon (e.g. one started
  via `lan-mouse daemon`), closing the GUI no longer kills it.
- If the daemon dies between startup detection and GTK connection,
  the GUI transparently spawns a replacement instead of hanging.
</content>
</entry>
<entry>
<title>refactor: collapse enter/leave hook spawning into shared helper</title>
<updated>2026-09-23T07:09:25Z</updated>
<author>
<name>Ty Smith</name>
<email>ty@tysmith.me</email>
</author>
<published>2026-05-27T19:46:07Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=a78362b56e8249c79e4d48b801216ede31e24086'/>
<id>urn:sha1:a78362b56e8249c79e4d48b801216ede31e24086</id>
<content type='text'>
The two spawn_*_hook_command functions were ~35 lines of near-byte-
identical glue (only the get_*_cmd call and log prefixes differed).
Replace with a single spawn_hook_command(handle, HookKind) and let
the kind carry the human label into log lines (which now also include
the client handle).

No behaviour change.
</content>
</entry>
<entry>
<title>feat: add leave_hook symmetric to enter_hook</title>
<updated>2026-09-23T07:09:25Z</updated>
<author>
<name>Ty Smith</name>
<email>ty@tysmith.me</email>
</author>
<published>2026-05-26T22:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=9b2b813c0517eee4966c3f042a8f9678885a73f4'/>
<id>urn:sha1:9b2b813c0517eee4966c3f042a8f9678885a73f4</id>
<content type='text'>
Per-client leave_hook fires sh -c &lt;cmd&gt; when capture for that client
is released. Wired through a single release_capture() chokepoint
covering release_bind, network send failure, Destroy-of-active-client,
and Release request paths.
</content>
</entry>
<entry>
<title>fix clippy lint</title>
<updated>2026-08-31T08:34:02Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>schober@cs.fau.de</email>
</author>
<published>2026-08-31T08:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=b115208aadb54ee6ed8f534f7b4d99c589916b0f'/>
<id>urn:sha1:b115208aadb54ee6ed8f534f7b4d99c589916b0f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(dns): resolve hostnames via the OS resolver instead of pure DNS</title>
<updated>2026-06-14T21:31:48Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-05-05T04:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=a42592ab055e2fdad6b6545de5a849a3fefeeff1'/>
<id>urn:sha1:a42592ab055e2fdad6b6545de5a849a3fefeeff1</id>
<content type='text'>
hickory_resolver's TokioResolver only consults /etc/resolv.conf and
queries upstream DNS servers — which means it can't see /etc/hosts,
mDNS (Avahi/Bonjour), NetBIOS, or anything else in the system's full
name-resolution stack. On a typical home LAN there's no DNS server
that knows about peer machine names, so users had to fall back to
typing IP addresses, which broke the moment they moved their setup
to a different network.

Swap to tokio::net::lookup_host, which calls getaddrinfo (or
GetAddrInfoEx on Windows). That walks /etc/nsswitch.conf on Linux
(picking up Avahi-resolved .local names, /etc/hosts, and DNS), uses
Bonjour for .local on macOS, and the full Windows resolver on
Windows. A Bonjour hostname like "JKMBP-M4-Max.local" now resolves
on every modern network without explicit configuration; the user
can carry their two machines between LANs and the connection still
finds them.

Drop the hickory-resolver dependency entirely — it's no longer
needed. ServiceError::Dns also goes away; lookup failures surface as
io::Error which is already covered by ServiceError::Io.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>chore: cargo fmt for peer-version code</title>
<updated>2026-06-14T20:59:26Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-05-06T19:41:21Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=c2f6e172bba692294cdb5c870d8aafdeec49f3b5'/>
<id>urn:sha1:c2f6e172bba692294cdb5c870d8aafdeec49f3b5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(version-exchange): also store peer commit on the listen side</title>
<updated>2026-06-14T20:59:26Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-05-05T06:18:32Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=32b6683cdaa6cc4614eb8631b6379cac5af04e77'/>
<id>urn:sha1:32b6683cdaa6cc4614eb8631b6379cac5af04e77</id>
<content type='text'>
Previously the Hello handler in `ListenTask` echoed our local commit
back but deliberately threw away the peer's, on the assumption that
the outgoing connect-side path (`connect.rs:278-279` →
`set_peer_commit`) would always populate the visible state for any
bidirectionally-configured peer.

That assumption breaks any time the *outgoing* TCP/DTLS direction is
broken even though the inbound direction is fine — happened just now
when the peer Mac's daemon stopped listening on 4242 (DHCP-renewed
IP, daemon crashed, asymmetric NAT, …). Mac was still happily
connecting in the other direction and sending events, including the
initial Hello, but Linux silently displayed "peer version unknown"
because the listen side dropped Mac's commit on the floor.

Add a `PeerHello { addr, commit }` EmulationEvent variant fired from
the listen-side Hello handler. The service maps `addr → ClientHandle`
via `client_manager.get_client(addr)` and calls `set_peer_commit` +
`broadcast_client` exactly like the connect path does. The connect
path remains the primary source for symmetric setups; this is the
defensive fallback so version visibility doesn't depend on outbound
reachability.

Skips silently when no outgoing client is configured for the peer's
addr (incoming-only setup) — there's no UI row to update in that
case anyway.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: peer version exchange with soft-warn UI indicator</title>
<updated>2026-06-14T20:59:26Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-05-04T18:50:40Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=72c86c0d8352684fc2d005522d4c5b496be0158b'/>
<id>urn:sha1:72c86c0d8352684fc2d005522d4c5b496be0158b</id>
<content type='text'>
Adds a one-shot Hello message to the lan-mouse wire protocol so each
peer can display the other end's build commit hash and warn on
version mismatch. Soft-warn only — mismatched versions never refuse
traffic.

Wire change (lan-mouse-proto)
* `ProtoEvent::Hello { commit: [u8; 8] }` carries the 8-byte ASCII
  short commit from shadow_rs's `SHORT_COMMIT`. Encoded/decoded
  alongside the existing event variants.
* `EventType::Hello` is appended to the enum so existing IDs are
  untouched. Old peers receive the event, hit `InvalidEventId`, and
  silently skip it via the forward-compat handler in
  `connect.rs::receive_loop` — the connection is unaffected.

Daemon
* Connect side sends one Hello immediately after the DTLS handshake
  authenticates and before the ping_pong loop starts. Best-effort,
  fire-and-forget — `log::debug!` on send error.
* Listen side mirrors the peer's Hello with its own (same shape as
  the existing Ping → Pong reply), so the peer's connect-side
  receive_loop populates `ClientState::peer_commit` for that
  handle.
* The disconnect path clears `peer_commit` so a stale hash isn't
  shown after the connection drops.

IPC
* `ClientState::peer_commit: Option&lt;[u8; 8]&gt;`. `None` means the
  peer hasn't sent Hello yet — either fresh connection or older
  build that predates the event.

GTK
* `ClientObject` exposes `peer-commit` as an `Option&lt;String&gt;`
  property; `peer_commit_to_string` converts the wire `[u8; 8]` to
  the displayable hex.
* `lan_mouse_gtk::run` now takes the local commit and stashes it in
  a `OnceLock` so per-row UI can compare against each peer's hash.
* `ClientRow::refresh_version_status` re-renders the collapsed
  subtitle with Pango markup whenever the property changes:
   - matched → green   "peer version: &lt;hex&gt; · matched"
   - mismatch → orange "peer version: &lt;hex&gt; · ours: &lt;hex&gt;"
   - unknown → orange  "peer version: unknown · ours: &lt;hex&gt;"
* Window invokes `refresh_version_status` from
  `update_client_state` after writing the new property, and
  `bind` calls it once on row construction so the initial
  subtitle isn't blank.

Known limitation: state-change broadcasts from the network side
(set_alive / set_active_addr / set_peer_commit) don't currently
trigger a `FrontendEvent::State` directly; the UI picks up the
latest values on the next user-driven broadcast. Same pre-existing
behavior as the alive/active_addr fields.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix(proto): tolerate undecodable peer datagrams instead of disconnecting</title>
<updated>2026-06-14T20:59:26Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-04-29T18:21:42Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=82766cdc87ab5ac2aab07a41cf955b687de8af1a'/>
<id>urn:sha1:82766cdc87ab5ac2aab07a41cf955b687de8af1a</id>
<content type='text'>
The DTLS recv loops in src/listen.rs and src/connect.rs each read
one full datagram per call. A failed `try_into::&lt;ProtoEvent&gt;()`
means the datagram's leading EventType byte didn't match any
known variant — a misalignment is impossible because DTLS is
message-framed, not stream-framed.

Previously, src/listen.rs would `break` out of the loop on parse
failure (tearing down the connection) and src/connect.rs would
silently swallow the error with no log. Both are wrong as
forward-compat behavior: any future protocol addition (e.g. a
new event variant) would force every existing peer to disconnect
rather than gracefully ignoring the unknown event.

Skip-and-continue on both sides, with a debug-level log so the
behavior is observable. Pre-requisite for any future ProtoEvent
variant to land without forcing a coordinated upgrade across
every peer in a deployment.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
