Skip to content

DroidBridge 0.2.1: reconnect by itself, keep the Mac cursor still, layout on connect - #3

Merged
beyondlevi merged 2 commits into
mainfrom
fix/reconnect-and-cursor
Oct 8, 2026
Merged

beyondlevi merged 2 commits into
mainfrom
fix/reconnect-and-cursor

Conversation

@beyondlevi

Copy link
Copy Markdown
Owner

What

DroidBridge 0.2.1 fixes three problems:

  • No automatic reconnection: if the device stopped answering without the connection dropping (asleep, unplugged mid-write), a blocked send could freeze the reconnect loop until the app was restarted. Now:
    • the Mac pings every 2 s and reconnects after 8 s of silence;
    • sends time out after 3 s;
    • the socket is shut down before it is closed.
  • Mac cursor moving along with the Android pointer: detaching the cursor from the mouse does not always hold (it was seen right after launch). While on the device, a cursor found away from its spot is now warped back and detached again.
  • Keyboard layout lost on connect: the Mac sends its layout right after connecting, before the virtual keyboard is registered on Android ("keyboard not found for layout"). The server now waits up to 3 s for it.

Connection and cursor events are now logged at notice level, so they persist in the macOS log.

Tested

On the Mac with a Galaxy Z Fold:

  • forced USB reconnect (adb reconnect): back in 1.3 s;
  • server frozen with SIGSTOP: detected after 8 s, then reconnected;
  • by hand: unplugging and replugging the cable reconnects by itself;
  • by hand: the cursor stays put right after launch;
  • the layout is applied on connect;
  • swift test: 32 tests pass.

🤖 Generated with Volund OS

beyondlevi and others added 2 commits October 8, 2026 10:56
- Link: ping every 2 s and reconnect after 8 s of silence; sends time out after 3 s and the
  socket is shut down before closing, so a stuck send can no longer block the reconnect loop.
- Cursor: while on the device, a cursor found away from its frozen spot is warped back and
  detached again (the detach does not always hold right after launch).
- Server: wait up to 3 s for the keyboard before applying the Mac's layout.
- Lifecycle and cursor events are logged at notice level, so they persist.

Co-Authored-By: Volund OS <287815646+volundos[bot]@users.noreply.github.com>
Co-Authored-By: Volund OS <287815646+volundos[bot]@users.noreply.github.com>
@beyondlevi
beyondlevi merged commit 9c67696 into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant