Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5be050b
docs(spec): design of a Deskflow server in ThinFloe
oetiker Nov 21, 2026
6f43844
docs(plan): Deskflow server step 1, the server core
oetiker Nov 21, 2026
7a89d5e
feat(deskflow): edge strip with pointer lock and keyboard capture
oetiker Nov 21, 2026
a733c24
feat(deskflow): protocol messages and framing
oetiker Nov 21, 2026
aee715e
feat(config): [deskflow] table and generated/deskflow
oetiker Nov 21, 2026
69aea70
feat(deskflow): TLS identity and fingerprints
oetiker Nov 21, 2026
684b197
feat(deskflow): pairing rules and protocol session
oetiker Nov 21, 2026
8a9c23b
fix(deskflow): verdict deadline and format characters in names
oetiker Nov 21, 2026
6f22542
feat(deskflow): state file and command socket
oetiker Nov 21, 2026
51e2263
feat(deskflow): listening daemon with pairing
oetiker Nov 21, 2026
aa4c5b6
feat(deskflow): key ids and modifier mask
oetiker Nov 21, 2026
6556057
feat(deskflow): edge geometry and edge resistance
oetiker Nov 21, 2026
0412a34
fix(deskflow): the run tests learn the port only once the socket is b…
oetiker Nov 21, 2026
838cc97
feat(deskflow): forward keyboard and pointer, release on every way back
oetiker Nov 21, 2026
d4d0221
fix(test): the OSD mark case switches off HEADLESS-2 again
oetiker Nov 21, 2026
2ef0dc5
feat(menu): run and supervise the Deskflow daemon
oetiker Nov 21, 2026
012eea2
fix(menu): a Deskflow daemon that cannot be waited for counts as ended
oetiker Nov 21, 2026
731bcd2
feat(menu): Deskflow band and devices in the monitor arrangement
oetiker Nov 21, 2026
8cc311c
fix(menu): reach a Deskflow device whose edge a monitor took; hide a …
oetiker Nov 21, 2026
0a1fdd7
docs(deskflow): notes, fresh-install exclusion, changelog
oetiker Nov 21, 2026
30344a7
fix(deskflow): no keep-alive echo, no recapture on the way home
oetiker Nov 21, 2026
7480d9a
fix(menu): Deskflow pending rows only while the daemon runs; keep the…
oetiker Nov 21, 2026
ac1fc38
docs(deskflow): the edge pixel the strip takes, client releases, iden…
oetiker Nov 21, 2026
0706303
fix(menu): empty each frame's texture changes after use
oetiker Nov 21, 2026
970fb12
feat(deskflow): clipboard codec and messages
oetiker Nov 21, 2026
a7d4b8b
feat(deskflow): Wayland clipboard bridge
oetiker Nov 21, 2026
f711914
feat(deskflow): bridge the text clipboard to attached devices
oetiker Nov 21, 2026
025c1ab
fix(deskflow): send a device ThinFloe's text only once
oetiker Nov 21, 2026
4a168d7
feat(menu): per-device clipboard switch for Deskflow
oetiker Nov 21, 2026
6316d50
test(deskflow): clipboard interop; docs
oetiker Nov 22, 2026
a3bab88
feat(labwc): a layer-surface inhibitor blocks every keybinding
oetiker Nov 22, 2026
efe6bff
feat(deskflow): media keys follow the pointer
oetiker Nov 22, 2026
90bf09c
fix(menu): an invalid [deskflow] never blocks a keyboard save
oetiker Nov 22, 2026
744b5a3
fix(deskflow): an uncarried copy empties the devices' clipboard
oetiker Nov 22, 2026
4edfce2
docs(deskflow): plan for the clipboard and media-key steps
oetiker Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## [Unreleased]

### New
- Settings → Screen has a switch "Let other computers use this keyboard and mouse (Deskflow)", off by default. Once it is on, computers that run the Deskflow client show up there, and after you compare the fingerprint you attach one beside a monitor. Pushing the pointer past that edge then moves keyboard and mouse to the computer, and Ctrl+Alt+Shift+Escape always brings them back.
- Text copied on ThinFloe can be pasted on a computer attached with Deskflow, and text copied there can be pasted on ThinFloe; images, files and texts over 1 MiB are not carried, and copying one on ThinFloe empties the clipboard of the attached computers. Each attached computer has a "Share the clipboard" switch in Settings → Screen, on by default.
- While the pointer is on a computer attached with Deskflow, the volume and brightness keys act on that computer and ThinFloe shows no volume or brightness display. The microphone mute key still mutes ThinFloe, when "Volume keys control this machine" is on.

### Changed

Expand Down
11 changes: 8 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ release.
- Stick writer and upgrades: `overlay/usr/bin/thinfloe-upgrade`.
- Time zone and NTP: `overlay/usr/bin/thinfloe-time` (live, as root), `install_local_time()` in `thinfloe-lib.sh` (boot), `overlay/usr/libexec/thinfloe/dhcp-timezone` (DHCP zone and NTP servers), the Time band in `timeband.rs`/`network_ui.rs`. Notes: [docs/notes/time-zone.md](docs/notes/time-zone.md).
- Add-ons: `overlay/usr/bin/thinfloe-addon` (its docstring lists the commands), hooks in `overlay/usr/libexec/thinfloe/addon-hooks/`.
- Deskflow server: `src/thinfloe-menu/src/deskflow/` (daemon, `thinfloe-menu --deskflow`), `deskflow_sup.rs` (the menu's supervision), `deskflowtab.rs`/`deskflow_ui.rs` (the Deskflow band). Notes: [docs/notes/deskflow.md](docs/notes/deskflow.md).
- Battery reader: `overlay/usr/libexec/thinfloe/peripheral-battery` and its units. Bolt microphone mute key (HID++ divert, F20 through uinput): `overlay/usr/libexec/thinfloe/logitech-keys` and `thinfloe-logitech-keys.service`, started by the same udev rule.
- Boot screen: `overlay/usr/share/plymouth/themes/thinfloe/`.
- User defaults: `overlay/home/tfuser/` (`.config/thinfloe/` with `environment`, `sessionrc` and `home-version`; `.thinlinc/tlclient.conf`). Layout of `~/.config/thinfloe/`: [docs/notes/home-persistence.md](docs/notes/home-persistence.md).
Expand Down Expand Up @@ -99,7 +100,7 @@ Not standing constraints, but each has broken something or is guarded by a test.
- labwc runs with `-C` on a directory composed by `thinfloe-compose-labwc-config` (system files symlinked, `environment` = system defaults, then `generated/environment`, then the user's file). Pointing `-C` at `/etc/thinfloe/labwc` again makes labwc reset user keys to the system values. Guards: `test-labwc-config-merge.sh`, `test-labwc-runtime.sh`. Story: [docs/notes/session.md](docs/notes/session.md).
- `thinfloe-save-home` takes the home from `getent passwd tfuser`, never `$HOME` (`sudo` sets `HOME=/root`), and every read under `/run/thinfloe/state` ends in `|| true` (`set -e`). On USB it writes only to the ESP mounted at `/run/thinfloe/storage/efi` (tested with `mountpoint -q`), atomically; the netboot upload uses `curl -f`. Exit codes 0 to 5 are a contract. Guard: `test-save-home.sh`.
- The remote-access password hash (`~/.config/thinfloe/password`) and the SSH host keys (`~/.config/thinfloe/ssh-host-keys`) ride the home archive in the clear: on the FAT ESP, or POSTed over plain HTTP on netboot. Accepted; see [docs/notes/home-persistence.md](docs/notes/home-persistence.md).
- A fresh install's home copy always leaves out `~/.config/thinfloe/ssh-host-keys` and `wg0.conf`, their 4.x paths, `~/.dbrrg-ssh-host-keys` and the attic copies in `~/cfg-attic/` (`IDENTITY_EXCLUDES`). Guard: `test_upgrade_image.py`.
- A fresh install's home copy always leaves out `~/.config/thinfloe/ssh-host-keys`, `wg0.conf` and `deskflow/` (the Deskflow private key), their 4.x paths, `~/.dbrrg-ssh-host-keys` and the attic copies in `~/cfg-attic/` (`IDENTITY_EXCLUDES`). Guard: `test_upgrade_image.py`.
- Reboot and power off from the session need `sudo systemctl ...`: the image has no polkit.
- Screen blanking uses `swayidle` and `wlopm`, never `wlr-randr --off`, which changes the monitor layout. No lock screen: tfuser has no password.
- No keybinding for a terminal or screenshots (see the keybinding constraint); from a VT: `XDG_RUNTIME_DIR=/run/user/1001 WAYLAND_DISPLAY=wayland-0 foot` (or `grim`).
Expand All @@ -114,6 +115,7 @@ Not standing constraints, but each has broken something or is guarded by a test.
- A `[keyboard]` value reaches `generated/environment` only through `keyboard::validate`, and values from outside the tab through `keyboard::repair`; the composer checks again with `thinfloe-menu --check-keyboard`. labwc 0.9.3 segfaults at start on a pair XKB cannot build. See [docs/notes/menu.md](docs/notes/menu.md) (Keyboard tab).
- The scale file `$XDG_RUNTIME_DIR/thinfloe-scale` is written atomically (one number and a newline); `labwc-scale`, `thinfloe-terminal` and the OSD read it.
- The OSD never takes focus or a click (layer overlay, empty input region, keyboard interactivity none), and only the composer writes `allowWhenInhibited`. See [docs/notes/media-keys.md](docs/notes/media-keys.md).
- Deskflow: the daemon is its own process (`thinfloe-menu --deskflow`) and reads only `generated/deskflow`, never `config.toml`; the menu is the only writer of `[deskflow]`. The state file `$XDG_RUNTIME_DIR/thinfloe-deskflow.state` (first line `self` or `error`, then `name<TAB>fingerprint<TAB>state<TAB>since<TAB>width<TAB>height<TAB>flags`) and the command socket `thinfloe-deskflow.sock` are a contract between daemon and menu; readers ignore unknown trailing fields. Getting back to ThinFloe never waits for the network or the client (Ctrl+Alt+Shift+Escape, watchdog, keep-alive), and no daemon may outlive the menu. Guard: `test-labwc-runtime.sh`. Notes: [docs/notes/deskflow.md](docs/notes/deskflow.md).
- Status area: an element is one module in `status/` plus a line in `status::ELEMENTS`; `draw` is pure and stays in its rect. The layout is `[status]` in `config.toml`, written only by the menu. Notes: [docs/notes/status-area.md](docs/notes/status-area.md).
- sysfs attribute files are read with `bounded::read_attr`, never a size-checked reader: sysfs reports one page (4096 bytes on most hosts) for every attribute, and a 256-byte check hid every GPU, MAC and WiFi chip in 4.6.0. Facts on the Network, Screen and This machine tabs are `infopanel::Line`s, labelled. Guards: `bounded`, `graphics` and `netdetail` tests (on the host's real `/sys`). See [docs/notes/menu.md](docs/notes/menu.md) (Settings facts).
- The battery file `/run/thinfloe/peripherals/battery` is a contract between the root reader and the menu: one line per device, `name<TAB>percent<TAB>state<TAB>read_epoch<TAB>kind`; the menu still reads a 4-field line (kind unknown). See [docs/notes/peripheral-battery.md](docs/notes/peripheral-battery.md).
Expand Down Expand Up @@ -206,7 +208,8 @@ defines none, and `containers/ubuntu/patches/0005-no-default-keybinds.patch`
removes that fallback. `thinfloe-compose-labwc-config` adds bindings only
when a switch in Settings → Keyboard is on, and then exactly the six media
keys with `allowWhenInhibited="yes"` (patch `0006`), which pass a ThinLinc
grab or an OxuLnk inhibitor; every other key reaches the focused program.
grab or an OxuLnk inhibitor but not the Deskflow capture strip's inhibitor
(patch `0007`); every other key reaches the focused program.
Adding any other binding is a deliberate decision followed by `make
test-runtime`. Guards: `test-session-packages.sh`,
`test-labwc-config-merge.sh`, `test-labwc-runtime.sh` (no `load default key
Expand Down Expand Up @@ -235,7 +238,8 @@ Guards: `scripts/check-boot-smoke.sh` (any `Found ordering cycle`),
The Dockerfile builds `labwc_0.9.3-1+thinfloe1` with
`containers/ubuntu/patches/` (fullscreen across outputs,
`LABWC_FULLSCREEN_SPAN_OUTPUTS`; `zwp_xwayland_keyboard_grab_manager_v1`;
no default keybindings, `0005`; `allowWhenInhibited` on a keybind, `0006`).
no default keybindings, `0005`; `allowWhenInhibited` on a keybind,
`0006`; a layer-surface inhibitor blocks every keybinding, `0007`).
The archive package silently loses all of them. Patches, overlay and brand
directories are `Makefile` prerequisites. Guards: `make test`, `make
test-runtime`, `test-container-inputs.sh`, `test-container-stamp.sh`.
Expand Down Expand Up @@ -365,6 +369,7 @@ and hardware results:
- [peripheral-battery.md](docs/notes/peripheral-battery.md): the battery reader, its units, the HID++ details and hardware results.
- [session.md](docs/notes/session.md): session startup, the user files, the labwc config merge, audio volume, screen blanking, GPU wait, terminals, screenshots.
- [time-zone.md](docs/notes/time-zone.md): the Time band, the precedence of menu, DHCP and `TZ=`, chrony and the DHCP NTP servers, and their tests.
- [deskflow.md](docs/notes/deskflow.md): the Deskflow server, pairing, capture and the way back, the state file and socket, known limits.
- [home-persistence.md](docs/notes/home-persistence.md): home restore and save, the archive, the password file, exit codes.
- [esp-and-upgrade.md](docs/notes/esp-and-upgrade.md): `thinfloe-upgrade`: home copy, size check, the batch interface, check timers.
- [network-boot.md](docs/notes/network-boot.md): netboot networking and its smoke test.
Expand Down
4 changes: 3 additions & 1 deletion containers/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
# default keybindings when rc.xml defines none
# (0005-no-default-keybinds.patch), and a keybinding marked
# allowWhenInhibited="yes" still runs under a keyboard grab or shortcuts
# inhibitor (0006-keybind-allow-when-inhibited.patch);
# inhibitor (0006-keybind-allow-when-inhibited.patch), but no keybinding
# runs while a layer surface with a shortcuts inhibitor, the Deskflow
# capture strip, has the keyboard (0007-layer-inhibitor-blocks-all-keybinds.patch);
# see docs/superpowers/specs/2026-07-27-labwc-multimonitor-fullscreen-design.md.
#
# Patches live in containers/ubuntu/patches/ and are appended to the source
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
Description: a layer-surface inhibitor blocks every keybinding
The Deskflow capture strip of thinfloe-menu is an overlay layer surface
that takes the keyboard exclusively while the pointer is on an attached
device. With 0004 an inhibitor on a layer surface was ignored, and the
media key bindings carry allowWhenInhibited="yes" (0006), so the volume
and brightness keys changed the local machine instead of reaching the
device, even over an X11 keyboard grab.
.
An inhibitor on a layer surface is now activated and stays in the wlroots
manager's list until it or its surface goes. While the seat's keyboard
focus is a layer surface with such an inhibitor, no keybinding runs,
allowWhenInhibited ones included, and every key goes to that surface.
Inhibitors on views behave as before.
.
thinfloe-specific: not proposed for upstream inclusion, see Forwarded below.
Author: ThinFloe maintainers
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-11-22
---
diff --git a/include/labwc.h b/include/labwc.h
index f4dfd8e..c0bc4ae 100644
--- a/include/labwc.h
+++ b/include/labwc.h
@@ -452,6 +452,7 @@ void server_finish(struct server *server);

void xwayland_keyboard_grab_manager_create(struct server *server);
void keyboard_shortcuts_inhibit_create(struct server *server);
+bool keyboard_shortcuts_inhibited_by_layer(struct seat *seat);

void create_constraint(struct wl_listener *listener, void *data);
void constrain_cursor(struct server *server, struct wlr_pointer_constraint_v1
diff --git a/src/input/keyboard.c b/src/input/keyboard.c
index e6f82a4..cb6bec1 100644
--- a/src/input/keyboard.c
+++ b/src/input/keyboard.c
@@ -538,6 +538,16 @@ handle_compositor_keybindings(struct keyboard *keyboard,
}
}

+ /*
+ * thinfloe (0007): a layer surface with the keyboard focus and a
+ * shortcuts inhibitor gets every key; no binding runs, not even an
+ * allowWhenInhibited one.
+ */
+ if (keyboard_shortcuts_inhibited_by_layer(seat)) {
+ cur_keybind = NULL;
+ return LAB_KEY_HANDLED_FALSE;
+ }
+
/*
* Handle compositor keybinds
*/
diff --git a/src/protocols/keyboard-shortcuts-inhibit.c b/src/protocols/keyboard-shortcuts-inhibit.c
index 38a0936..8397c31 100644
--- a/src/protocols/keyboard-shortcuts-inhibit.c
+++ b/src/protocols/keyboard-shortcuts-inhibit.c
@@ -20,6 +20,8 @@
#include <wayland-server-core.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
+#include <wlr/types/wlr_layer_shell_v1.h>
+#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "common/mem.h"
#include "labwc.h"
@@ -33,6 +35,8 @@ struct lab_shortcuts_inhibitor {

static struct wl_listener on_new_inhibitor;
static struct wl_listener on_manager_destroy;
+/* thinfloe (0007): to find the inhibitors of a focused layer surface */
+static struct wlr_keyboard_shortcuts_inhibit_manager_v1 *inhibit_manager;

static void
handle_view_destroy(struct wl_listener *listener, void *data)
@@ -66,7 +70,15 @@ handle_new_inhibitor(struct wl_listener *listener, void *data)
wlr_surface_get_root_surface(inhibitor->surface);
struct view *view = root ? view_from_wlr_surface(root) : NULL;
if (!view) {
- /* No window (e.g. a layer surface): nothing to inhibit for. */
+ /*
+ * thinfloe (0007): no window. An inhibitor on a layer surface
+ * needs no count: wlroots keeps it in the manager's list until
+ * it or its surface goes, and keyboard_shortcuts_inhibited_by_
+ * layer() looks it up there while the layer has the focus.
+ */
+ if (root && wlr_layer_surface_v1_try_from_wlr_surface(root)) {
+ wlr_keyboard_shortcuts_inhibitor_v1_activate(inhibitor);
+ }
return;
}

@@ -87,6 +99,33 @@ handle_manager_destroy(struct wl_listener *listener, void *data)
{
wl_list_remove(&on_new_inhibitor.link);
wl_list_remove(&on_manager_destroy.link);
+ inhibit_manager = NULL;
+}
+
+/*
+ * thinfloe (0007): true while the seat's keyboard focus is a layer surface
+ * with an inhibitor. A layer surface that takes the keyboard exclusively
+ * and asks for the inhibition (the Deskflow capture strip) gets every key,
+ * so no keybinding runs, allowWhenInhibited ones included: the volume and
+ * brightness keys go to the client that holds the keyboard.
+ */
+bool
+keyboard_shortcuts_inhibited_by_layer(struct seat *seat)
+{
+ struct wlr_surface *focused = seat->seat->keyboard_state.focused_surface;
+ if (!inhibit_manager || !focused
+ || !wlr_layer_surface_v1_try_from_wlr_surface(focused)) {
+ return false;
+ }
+ struct wlr_keyboard_shortcuts_inhibitor_v1 *inhibitor;
+ wl_list_for_each(inhibitor, &inhibit_manager->inhibitors, link) {
+ if (inhibitor->seat == seat->seat
+ && wlr_surface_get_root_surface(inhibitor->surface)
+ == focused) {
+ return true;
+ }
+ }
+ return false;
}

void
@@ -99,6 +138,7 @@ keyboard_shortcuts_inhibit_create(struct server *server)
wlr_log(WLR_ERROR, "cannot create the keyboard shortcuts inhibit manager");
return;
}
+ inhibit_manager = manager;
on_new_inhibitor.notify = handle_new_inhibitor;
wl_signal_add(&manager->events.new_inhibitor, &on_new_inhibitor);
on_manager_destroy.notify = handle_manager_destroy;
Loading
Loading