Skip to content

Feat/wayland bidi and gui - #1

Merged
Wjouter merged 11 commits into
mainfrom
feat/wayland-bidi-and-gui
Jul 1, 2026
Merged

Wjouter merged 11 commits into
mainfrom
feat/wayland-bidi-and-gui

Conversation

@Wjouter

@Wjouter Wjouter commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Add feat to main

Wjouter and others added 10 commits July 1, 2026 11:28
…alized space

Add config.Save (TOML encoder) and a bidirectional flag so the daemon can be
driven entirely from config. Add Wayland-only edges (selectable/disable) and
switch_modifier (Easy-Mouse-style gating). Drop remote_width/height — the
virtual cursor is tracked in MWB's normalized 0..65535 space, so the remote
resolution is auto-mapped. Simplify all systemd units to bare 'mwb'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…libei

Add a Wayland driver (cgo + libei, build tag 'wayland') using the
org.freedesktop.portal.InputCapture portal: pointer barriers for edge
detection, compositor input suppression, and Release to warp the cursor back —
replacing the X11 xdotool/xinput path. Reuse the existing handleRel/handleKey
forwarding. Persist the portal grant (persist_mode + restore_token) so the
permission dialog only appears once.

Also: switch to normalized 0..65535 coordinates; any-edge switching with
selectable/disable edges; modifier-gated switching; smoother motion
(single combined packet + sub-pixel accumulation); fixed scroll direction,
touchpad scroll, horizontal scroll; middle/X button support. X11 path kept
working (best-effort). Adds godbus dep and a build-wayland make target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a 'mwb gui' subcommand serving a localhost page (stdlib net/http +
embed.FS) to edit all config fields, toggle bidirectional/edges/modifier,
and start/stop/enable the systemd user service with live status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Capture raw decrypted bytes on RecvPacket and dump unknown/clipboard/drag
packet types at debug level, turning the client into a decrypting analyzer.
Used to reverse-engineer the file-transfer protocol.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implement MWB's separate clipboard data channel (base port 15100): AES + IV
handshake, 64-byte DATA header exchange, then a 1024-byte UTF-16LE
"<size>*<filename>" header followed by the raw file bytes (reverse-engineered
from PowerToys SocketStuff.cs/Clipboard.cs).

Both directions: a beat-triggered pull saves incoming files to
~/Downloads/MouseWithoutBorders and puts them on the local clipboard; a server
on 15100 streams the local clipboard file to peers that pull. Local file
detection and clipboard set use wl-clipboard (Wayland) or xclip (X11).
Replaces the diagnostic auto-ask with the real pull. 100MB cap, single files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Send a MachineSwitched handoff when the cursor crosses to the remote — this is
what triggers the remote to pull our clipboard (it checks for a recent beat on
MachineSwitched). Respond to a ClipboardAsk by pushing the file to the asker's
port (MWB's owner-pushes-on-ask model) instead of replying with in-band text.
Zero-pad the final file block to satisfy the AES-CBC 16-byte alignment (the
receiver reads exactly dataSize and ignores padding) — fixes truncated/0KB
files for sizes not divisible by 16.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a fork notice, a comprehensive 'What's new in this fork' section, and
upstream attribution in Acknowledgments. Update features/intro for Wayland,
GUI, file transfer, any-edge + modifier switching. Note that prebuilt installs
pull upstream (X11-only) and recommend building from source (make build-wayland).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…guide

Remove the one-line/.deb/binary install methods (they pull upstream's X11-only
releases). Rewrite Installation as a self-contained from-source guide: per-distro
deps (Wayland + X11), uinput/input-group setup, and build+install. Add a Makefile
install-wayland target (and install-only) so installing the Wayland build no
longer clobbers it with an X11 rebuild. Update Run/troubleshooting/structure for
Wayland (no sudo, wl-clipboard, portal isolation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xclip reads a stale XWayland clipboard on Wayland sessions, so text and
image sync silently used outdated content. The file-transfer path already
routed through wl-clipboard; extend that to getLocalClipboard,
setLocalClipboard, and getLocalImageClipboard/handleImageClipboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Wjouter Wjouter self-assigned this Jul 1, 2026
- errcheck: annotate defer Close() on read-only sockets/files; check
  config.Save's Close error explicitly since it flushes a write
- staticcheck: drop a dead no-op HasPrefix branch in uriToPath
- unused: move touchpadPxPerNotch into portal_wayland.go (wayland-tag
  only), where it's actually referenced — the default build never sees it
@Wjouter
Wjouter merged commit 7de8339 into main Jul 1, 2026
2 checks 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