<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lan-mouse/lan-mouse-ipc/src/connect.rs, branch main</title>
<subtitle>a fork</subtitle>
<id>https://git.nsrddyn.com/lan-mouse/atom/lan-mouse-ipc/src/connect.rs?h=main</id>
<link rel='self' href='https://git.nsrddyn.com/lan-mouse/atom/lan-mouse-ipc/src/connect.rs?h=main'/>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/'/>
<updated>2026-09-23T07:41:46Z</updated>
<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>Add rustfmt.toml for explicit styling (#348)</title>
<updated>2025-11-02T10:52:01Z</updated>
<author>
<name>NeoTheFox</name>
<email>soniczerops@gmail.com</email>
</author>
<published>2025-11-02T10:52:01Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=3f13714d8a68e5600cf2c82977f6ce358d60ba42'/>
<id>urn:sha1:3f13714d8a68e5600cf2c82977f6ce358d60ba42</id>
<content type='text'>
* Propose an explicit .rustfnt.toml
Use 2024 style, 4 spaces for tabs and epand the default width a tad

* Auto-format the existing code with new rules</content>
</entry>
<entry>
<title>extract frontend crate (#186)</title>
<updated>2024-09-04T15:29:29Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>ferdinandschober20@gmail.com</email>
</author>
<published>2024-09-04T15:29:29Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=be677d4c8167b4f6cfdc56082dd698f596c59a59'/>
<id>urn:sha1:be677d4c8167b4f6cfdc56082dd698f596c59a59</id>
<content type='text'>
</content>
</entry>
</feed>
