Commit Graph
184 Commits
Author SHA1 Message Date
nandi 2e00009c79 Add display rotation: Rot pill, chandra-ctl rotate, sensor auto-rotate
CI / test (push) Failing after 51s
- Rotate the display 0/90/180/270 degrees in the KMS host, with scanout and libinput touch/pointer coordinates transformed to match
- Add a touch "Rot" pill beside "KB": tap turns 90 CW, long-press or right-click flips 180
- Add `chandra-ctl rotate [cw|ccw|flip|0|90|180|270|status]`; CHANDRA_ROTATE sets the initial orientation
- Add session/chandra-auto-rotate, which follows iio-sensor-proxy orientation (disable with CHANDRA_AUTO_ROTATE=0)
- Advertise window_menu, maximize, fullscreen and minimize via xdg_toplevel.wm_capabilities (xdg_wm_base v5+)
- Add docs/handset.md covering handset touch, scaling, OSK and rotation
2026-11-28 00:39:24 -08:00
nandi 905dab8725 Add a built-in on-screen keyboard for handset sessions
CI / test (push) Failing after 52s
- Opens for text-input-v3 fields, terminals, launcher search, Network password, emoji picker and the password dialog; a KB pill summons it manually.
- Enabled on CHASSIS=handset; CHANDRA_OSK=1|0 overrides, and it stays off under CHANDRA_TEST_CONFIG.
- Work area and panel popups shrink above the keyboard so focused content stays visible.
- Keys send evdev codes with Shift, Ctrl and Alt modifiers.
- chandra-ctl: `screenshot [PATH]` saves a PNG without opening the editor.
- Key names cover the full punctuation set and shifted symbols.
- Launcher plasmoid min width drops from 60 to 36.
2026-11-28 00:18:32 -08:00
nandi 1205329abd KMS: map touch to the left pointer button; toolchain: add aarch64
CI / test (push) Canceled after 0s
- kms: touch down, move and up drive the pointer and send BTN_LEFT, so touchscreens work without a mouse. Only the first finger (tracked by seat slot) controls the pointer.
- A held touch is released on VT switch and on close, so the button is never left stuck down.
- setup-toolchain.sh: fetch wasm-tools, wit-bindgen, wasmtime and the wasmer C API for aarch64 as well as x86_64. Other architectures still fail with an error.
2026-11-27 22:24:33 -08:00
nandi c1c4349584 Web host: give the page a moon favicon
CI / test (push) Failing after 2m59s
- Add favicon.svg: a crescent moon on a dark rounded tile
- Link it from host/web/index.html as the page icon
- serve.mjs: allow /favicon.svg through the path filter and serve it as image/svg+xml
2026-11-27 16:14:41 -08:00
nandi 1871d50a3e X11 dock bridge: show and control host EWMH windows under --x11
CI / test (push) Failing after 2m37s
Under --x11 with a host EWMH window manager (e.g. Openbox in Gamerig),
Chandra is one top-level X11 client while other apps run directly on Xorg,
so the dock only saw Chandra's Wayland windows.

- compositor/x11: intern EWMH/ICCCM atoms and track _NET_CLIENT_LIST,
  _NET_ACTIVE_WINDOW, titles, and window states via PropertyChangeMask,
  filtering non-taskbar/child windows and adding focus, close, minimize,
  and toggle-maximize EWMH/ICCCM actions.
- compositor/shell: add resolve_external_app_id (matching WM_CLASS and
  StartupWMClass against installed .desktop files) and publish_windows.
- compositor/host: bridge ExternalWindow entries with bit-30 tagged IDs
  into shell.windows/win_list while keeping Wayland wm.windows and session
  snapshots untouched, and route activate_task / window_command actions.
- compositor/app, compositor/bin, docs/x11.md: wire external window sync
  before X11 input handling and register ExternalWindowHandler.

Verified: moon test --target native compositor/x11 compositor/shell (38/38),
external_windows_test.mbt + dock_test.mbt (3/3), build-compositor-wasm.sh,
and moon build --target native compositor/bin.
2026-11-27 14:33:26 -08:00
nandiandClaude Sonnet 5.5 15b7c3f0e3 Merge origin/main into the memory leak fix
CI / test (push) Successful in 5m49s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hj5m35Lj6Rt9vwwLGZ
2026-11-26 17:11:01 -08:00
nandiandClaude Sonnet 5.5 ada9850b8d Fix the memory leak that filled RAM and swap; launch monitor, memory log
wasmhost leaked the arguments of every host call. wt_stub.c handed them to
the MoonBit dispatcher expecting it to own them, but the compiler borrowed
the parameter, so nothing released them (about 600 kB/s in a test with one
busy terminal; a long session reached over 16 GB resident plus swap).
MoonBit now allocates the buffer and C copies into it.

Also:
- Unannotated pointer FFI parameters default to #owned, and none of these C
  functions released theirs, including the native KMS present (a whole frame
  each). Annotated #borrow; the wasmhost build now fails on that warning,
  which --warn-list -a had hidden.
- Watched launches forked the whole compositor, and each monitor kept a
  snapshot of its heap for the app's lifetime. It now posix_spawns a fresh
  copy of the binary that takes over before main.
- The host logs memory, window buffers and images once a minute.
- chandra-session keeps the previous log as session.log.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hj5m35Lj6Rt9vwwLGZ
2026-11-26 17:10:47 -08:00
nandi 5c8ca1cbc9 Merge pull request 'wasmhost: fix build on current MoonBit (Str(_) partial application)' (#2) from fix/moon-partial-application into main
CI / test (push) Failing after 19m24s
2026-11-26 11:21:16 +00:00
Claude 0bc87b2a8b wasmhost: build on MoonBit 0.1.20261126 (no f(_) partial application)
CI / test (push) Canceled after 0s
Today's moon removed the `f(a, _, b)` partial-application syntax, so
wasmhost/wt/val.mbt failed to compile and the host couldn't be built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgr6CYxRpahHeEsEqZ
2026-11-26 11:20:19 +00:00
nandiandClaude Opus 5.5 bcd7751f1a wasmhost: replace removed partial-application syntax (Str(_))
CI / test (pull_request) Failing after 19m24s
Current MoonBit (0.1.20261126) rejects f(_) partial application, so build-wasmhost.sh failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkMiWbNDLzKrZvtZWu
2026-11-26 11:12:06 +00:00
nandiandClaude Sonnet 5.5 7912a0b32b Emoji font: install it readable, and retry a failed load
CI / test (push) Failing after 44m48s
The fetch script downloaded through mktemp (0600) and the installer kept
that mode, so the session couldn't read the root-owned font and reported
it missing. The failure was also cached until the next session.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 00:12:06 -08:00
nandiandClaude Sonnet 5.5 44688453d7 Icons: load an absolute Icon= path that has no extension
CI / test (push) Failing after 31m49s
AppImage managers write icons as extensionless files, so those apps got the
generic icon. Any absolute path is now tried, and the loaders tell PNG and SVG
apart from the contents.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 23:01:20 -08:00
Claude 27252a97ab Emoji picker (Super+.): search, tabs, skin tones, recents, text-input-v3 insertion
CI / test (push) Canceled after 0s
Compositor-drawn Win+. style picker. The focused app keeps keyboard focus so
its text-input-v3 field stays enabled; the emoji goes in with commit_string,
or onto the clipboard with a visible notice when the app has no text field.
Shortcut lives in the shortcut table (rebindable in Settings > Shortcuts).

- compositor/wayland/text_input.mbt: zwp_text_input_manager_v3 (global 12)
- compositor/emoji: Emoji 18.0 + CLDR 49 data (Unicode License), search,
  picker model, CBDT/CBLC + GSUB reader for Noto Color Emoji
- Chandra's own pinned bitmap Noto Color Emoji (scripts/fetch-emoji-font.sh,
  just emoji-font); Fedora's COLRv1 copy can't be drawn. Missing font shows
  an error panel.
- raster WIT: emoji-font, emoji-has, emoji-image; served by wasmhost
- state.edn :emoji {:recent [...] :skin-tone n}
- tests incl. a fake text-input client; docs/emoji-picker.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkABDGJixotaqFv2X2
2026-11-26 07:00:22 +00:00
nandiandClaude Sonnet 5.5 738928352e Face unlock: let polkit's sandboxed PAM helper open cameras
CI / test (push) Canceled after 28m1s
polkit 126+ runs the password dialog's PAM stack in polkit-agent-helper@.service,
whose PrivateDevices=yes leaves no cameras in /dev, so the dialog reported "no
camera" while sudo and enrolling worked. Install a drop-in that allows only V4L2
devices and keeps the capability and syscall limits PrivateDevices= added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 22:33:44 -08:00
Claude 2752b81e36 Session: wait for the document portal's mount before reopening apps; say when it's broken
CI / test (push) Canceled after 1m11s
V's session.log had kwi (a Flatpak) failing with "bwrap: Can't find source path
/run/user/1000/doc/by-app/org.kde.kwi". At login chandra-session restarts
xdg-desktop-portal, and xdg-document-portal stopped and started with it in the
same second (V's journal, 21:36:12); a Flatpak started in that gap, such as one
session restore reopens, finds no FUSE mount to bind into its sandbox.

When flatpak is installed, chandra-session now asks the document portal for its
mount point (which also starts it), waits up to 5 s for the FUSE mount and
checks it answers. If it doesn't, the reason goes to the log and into
CHANDRA_SESSION_ERRORS, which the shell shows as an error notice once the desktop
is up (DesktopShell::show_session_errors). A missing dbus-send is reported too.

Tested: the snippet against a real xdg-document-portal on a dbus-run-session bus
(mounted after 0 waits) and with an unreachable bus (error text); the notice in
compositor/host/launch_test.mbt and headless with build/wasmhost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiGJWeuHiTgtoyB4kb
2026-11-26 06:29:54 +00:00
nandiandClaude Sonnet 5.5 70b24ffe47 Private bus: don't take over the session's document portal mount
CI / test (push) Canceled after 24m10s
A nested compositor's private D-Bus kept the session's XDG_RUNTIME_DIR, so
an xdg-document-portal activated on it mounted over $XDG_RUNTIME_DIR/doc and
removed the mount when the bus exited. The session's portal kept running
without it, and flatpak apps stopped starting.

The bus now has its own config that starts the document portal with a runtime
directory per compositor. scripts/test-private-bus.sh covers it. The KDE
colors test gets its own runtime directory for the same reason.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 22:06:51 -08:00
Claude 50149e6b99 Launches that fail say why: command, exit status and what it printed
CI / test (push) Canceled after 17m11s
V: "kwi not starting from app menu or dock". Kwi is a Flatpak, and bwrap died
before it opened a window ("Can't find source path /run/user/1000/doc/by-app/
org.kde.kwi"); Chandra forked apps and forgot them, so the failure only reached
the session log and the click did nothing visible.

Every app the Applications menu, the dock, Super+1..9 and session restore start
now runs under a small monitor (sys spawn-watch, compositor/sys/sys_stub.c): it
copies the app's output to the session log as before, keeps its last 2 KiB,
and reports how sh -c CMD exited on a socket the main loop wakes on. The shell
(compositor/shell/launch.mbt) shows a red error notice for 15 s, and logs it,
when the app exits non-zero or by a signal within 30 s, or exits 0 without ever
opening a window here (after a 2 s grace for single-instance hand-offs): the
first line says what happened, then the command and the last lines it printed,
repeats folded ("(3 times)"). Status 127/126 say "command not found" / "not
executable". Launched apps no longer inherit the compositor's fds.

chandra-ctl launch ID starts a desktop app exactly as the dock does.

Tests: compositor/host/launch_test.mbt (bwrap-style failure incl. drawn notice,
127, SIGSEGV, exit 0 without a window, an app that keeps running), unit tests
in launch.mbt. Checked end to end with build/wasmhost + compositor.wasm
headless and a Flatpak-style kwi desktop file: chandra-ctl launch org.kde.kwi
shows the notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiGJWeuHiTgtoyB4kb
2026-11-26 05:48:39 +00:00
Claude 77fcc4db1c Screenshot editor: annotate, blur, pixelate, redact and crop before saving
CI / test (push) Canceled after 12m58s
Every screenshot now opens in an editor after KDE Spectacle's annotation mode:
Arrow, Line, Rectangle, Ellipse, Pen, Highlighter, Text, Number markers, Blur,
Pixelate, Redact and Crop, 8 colours, 3 sizes, undo/redo. Enter saves and
copies, Ctrl+C copies only, Esc discards.

- Drawn by the compositor (shot_editor.mbt), keyboard owned by it while up.
- Annotations are drawn into the picture's pixels at full size (annotate.mbt),
  so what is shown is what is saved. Blur = 6x6 block average + 3 box-blur
  passes; redact is opaque; both touch only their box (pixel tests).
- The picture goes to the renderer as <=2 MB strips: one 8 MB image-pixels
  call exhausts wasmtime's hostcall fuel and killed the wasm host.
- Frame callbacks are held while the overlay/editor freeze the screen, so apps
  behind stop drawing (0% CPU vs 52% with a full-screen animating app).
- wasmhost: error buffer 16 KB so trap causes aren't cut off; image-pixels
  limit 1024 -> 16384 a side (both hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hh3TaFJh7nhCxAjV4Q
2026-11-26 05:37:03 +00:00
Claude 76a23f7816 Drag and drop: files can be dragged between windows and within one
CI / test (push) Canceled after 4m0s
The compositor ignored wl_data_device.start_drag, so no drag ever reached a
window: Dolphin, GNOME Files, Chrome tabs and text could not be dropped
anywhere, not even inside the window they started in.

Now (compositor/wayland/dnd.mbt, compositor/host/dnd.mbt):
- start_drag while a button is held on the client turns the pointer into the
  drag (the origin gets wl_pointer.leave); a request that arrives after the
  release is cancelled at once.
- The surface under the pointer (windows, subsurfaces, menus) gets
  data_offer + offer + source_actions + enter, then motion and leave; a drag
  without a source stays inside its own client.
- accept -> source.target, set_actions -> copy/move/ask agreed and sent as
  offer.action and source.action (version 3), version 1/2 clients copy.
- Release drops when the target accepted a type and an action: drop,
  dnd_drop_performed, and finish -> dnd_finished; otherwise cancelled + leave.
  Escape cancels. The window dropped on becomes active, so Dolphin's
  Copy/Move Here menu opens as a menu of a focused window.
- The drag icon is drawn under the pointer at its hotspot (attach offsets and
  wl_surface.offset), above windows and menus.
- A source, icon or client going away ends or updates the drag.

Tests: compositor/host/dnd_test.mbt (fail on the previous commit). Checked
headless with real Dolphin 23.08 (Qt 5.15) and GNOME Files 46 on both the
native build and the wasm build: Files -> Dolphin, Dolphin -> Files,
Dolphin -> Dolphin (Move/Copy/Link menu) and a move into a folder inside Files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjWb2dWbR1K7qoMgWP
2026-11-26 05:31:33 +00:00
Claude 80af76fb15 Password dialog rebuilt: a separate polkit agent, one state machine, explicit errors
CI / test (push) Canceled after 21m14s
The first version ran polkit registration, polkit-agent-helper-1, the PAM
conversation and the drawing inside the compositor's frame loop, with
overlapping state in two layers. A helper that quit before asking was taken
for a wrong password and restarted in a loop that wiped the field (typing
seemed dead), a refused registration quietly started a third-party agent,
and the dialog and the Face unlock window each grabbed the keyboard.

Now:
- chandra-polkit-agent (compositor/authagent, /usr/local/lib/chandra) does
  polkit and PAM. Each request runs one state machine (polkit/machine.mbt:
  starting, asking, checking, failed, done). A check that quits or can't
  start is Failed with the reason and waits for Try again; only a wrong
  password starts the next check by itself. It logs each step to stderr
  (the session log), never the typed text.
- The compositor starts it on a socket pair and only draws what it says
  (host/auth.mbt, auth_draw.mbt; line protocol in polkit/wire.mbt). One
  input owner (grab_input): the dialog, else the Face unlock window.
- No silent fallback: if the agent can't run, polkit refuses it, polkit
  doesn't answer in 10 s, or it dies, a notice on screen says why (a crash
  after it ran restarts it, up to 3 times, and says so). The third-party
  agent runs only when the Settings switch is off.
- chandra-ctl auth-demo [password|face|face-ok|die|slow|users] shows the
  real dialog with a pretend check (password "demo"), no root needed;
  chandra-ctl auth-status says whether the agent is registered.
- just install builds and installs the agent (just auth-agent).

Tests: polkit_test (link, machine, view, helper Gone) and auth_test end to
end through handle_input: the agent loop in-process against a mock polkit
on a private dbus-daemon plus a mock helper, and the real agent program
spawned by the compositor (demo, and registered with the mock polkit).
Typing on a real xkb keymap, wrong password, cancel, withdrawal, helper
quitting early or missing, polkit refusing, agent not starting or crashing,
demo modes, Face unlock Apply. 170/170 host and 20/20 polkit tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE
2026-11-26 05:09:49 +00:00
Claude 2c33c4a847 Text selection in terminals: drags stay with their window, middle-click paste works
CI / test (push) Canceled after 4m14s
V: "kwi is having problems selecting text". Two compositor gaps:

- No implicit pointer grab. A drag that started in a window lost it as soon as the pointer
  crossed its edge (onto the frame, the panel, a divider or another window): the client got
  wl_pointer.leave mid-drag (Qt then forgets the held button), and the release went to the
  other window or nowhere, so the terminal's selection never ended and kept following the
  pointer. Selecting past the top/bottom edge to scroll, which Kwi and Konsole autoscroll on,
  could not work. Now a press forwarded to a client grabs the pointer: motion (in that
  surface's coordinates, also outside it), the wheel and every button go to it until the last
  button is up; then the pointer goes to whatever is under it. Anything that takes the pointer
  (a window move or resize, the overview, a screenshot) ends the grab as before.
- No primary selection. zwp_primary_selection_device_manager_v1 was not offered, so Qt's
  QClipboard::supportsSelection() was false: selected text was never put on the primary
  selection and a middle click pasted nothing. Now offered (v1), with the offer sent to the
  focused client like the clipboard.

Checked headless with Konsole (Qt 5 Wayland): a selection dragged out of the window keeps
extending, is set as the primary selection on release, and a middle click in another Konsole
window pastes it. Tests in selection_test.mbt (both grab tests fail without the fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5himKXPLcfCZN6BXByd
2026-11-26 05:07:25 +00:00
Claude 516180196f Face unlock: say why a camera can't be used, list the cameras, pick one
CI / test (push) Canceled after 21m7s
"no camera at PATH" now says why (not there or a broken link, permission
denied, not a V4L2 device, a metadata node rather than the picture node,
OpenCV couldn't start it or it gives no picture: another app using it) and
lists the cameras found (VIDIOC_QUERYCAP on /dev/v4l/by-id/* and /dev/video*).
New commands: `chandra-face cameras`, `chandra-face set-camera PATH` (root,
edits device in face.conf after checking it is a capture node). The Face
unlock window shows the cameras found with a Use button (one password), then
opens again. just install prints NOT READY with the reason when the
configured camera can't be used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
2026-11-26 04:47:06 +00:00
Claude ff6f733810 chandra-ctl windows: how Chandra sees each window, and what the pointer is over
CI / test (push) Canceled after 7m7s
For "this window won't resize" reports (V's Gajim still not resizing on real hardware,
while a libadwaita window built like Gajim's resizes headless on both hosts): one line per
window with its frame kind (client-frame / chandra-frame), layout state (floating, tiled,
maximized, fullscreen), box, buffer, the client's shadow per side, min/max size and title,
then the pointer position and what it's over (a resize grip and which edge, a window, a
title bar, a tiling divider, the panel, the desktop).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiu4r7mEXBdKY6cgv6
2026-11-26 04:39:45 +00:00
Claude db442879f5 Subsurfaces are drawn and get the pointer: Chrome's toolbar bubbles work
CI / test (push) Canceled after 14m47s
Chrome draws the bubbles of its toolbar buttons (bookmark star, downloads, extensions) as
wl_subsurfaces of the window, not xdg_popups. Chandra accepted wl_subcompositor.get_subsurface
but never drew a subsurface or sent it input, so those buttons seemed to do nothing (the
bookmark was even added, with no bubble). Menus (xdg_popup) were unaffected.

- Server: subsurface state (parent, position) per child surface; a child commit or
  set_position reports SubsurfaceCommitted(window, child, x, y, buffer) with the position
  added up to the window's surface, and a null buffer or destroy reports SubsurfaceUnmapped.
- Host: HostWindow.subs, drawn above the window as undecorated scene nodes (no change to any
  renderer); the pointer enters the topmost subsurface under it (ptr_sub) with its own
  coordinates, so clicks reach the bubble.

Checked headless with Chromium 158 on Ozone Wayland, in both frame modes: the star bubble
opens and its Remove button works. Test in csd_test.mbt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkfW5ttNd831XmdsC5
2026-11-26 04:19:53 +00:00
Claude 41c6ec1135 Remove the Rust host (host-wasm)
CI / test (push) Canceled after 0s
The MoonBit host (wasmhost/, build/wasmhost) is the only host now. Gone:
host-wasm/ (Rust on the wasmtime crate, ~5,700 lines incl. Cargo.lock),
the run-rust, run-drm-rust and host-wasm recipes, and `just install --rust`
(both the recipe and session/install.py now stop with an error naming the
removal instead of quietly ignoring the flag). remote-build.sh builds and
pulls build/wasmhost. README, wasmhost/README and docs no longer describe a
second host, apart from short history notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiBxpbLoeUM9xfZayq
2026-11-26 04:19:19 +00:00
Claude 024f18ce61 Screen recordings keep up with animations: every drawn frame, up to 60 fps, with its real time
CI / test (push) Canceled after 0s
A recording of an animation looked choppy because frames barely reached ffmpeg: each 8 MB
1080p frame went out only as far as the socket buffer took it on each main loop pass, so a
new frame could be taken only every few hundred ms (V's recording changed picture ~12 times a
second; headless, 2 a second). Frames were also stamped when ffmpeg read them, not when drawn,
and every grab forced a full redraw.

Now:
- Both hosts (wasmhost raster_stub.c, host-wasm main.rs) copy a frame into a 3-slot queue and
  a writer thread sends it, so a frame never waits on the main loop. A full queue (ffmpeg
  behind) means that frame is not taken; the next one is, with its own time.
- The stream is uncompressed RGBA in Matroska (recorder.mbt mkv_stream_header /
  mkv_frame_header; the hosts write the same 42-byte cluster header), each frame stamped
  with the time it was drawn. ffmpeg makes constant 60 fps H.264 from it, under nice -n 10.
- A frame is taken when the desktop draws a changed frame (app.mbt draw_frame,
  compose_frame), at most 60 a second, or when the pointer moves. A still screen sends
  nothing; the REC pill redraws only its own rectangle when its seconds turn.
- ffmpeg going away mid-recording says so in the notification.
- Tests: the cluster header bytes, ffprobe reading the stream with each frame's own time,
  and the recording test now checks a 60 fps file as long as the recording ran. The
  recording tests fail with a clear message when ffmpeg/ffprobe are missing instead of
  returning early; CI installs ffmpeg.

Headless 1080p, one window redrawing at 60 fps (rec-bench.sh in project files
recorder-smooth/): distinct frames in the video 2.1/s -> 58.9/s (MoonBit host), 59.1/s
(Rust host); overview open/close 1.8/s -> 38.7/s (its previews refresh at 5-10/s live).
Compositor kept drawing 57 fps while recording; still screen: compositor 8% CPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjEUQq16Te1LPYMinT
2026-11-26 04:14:28 +00:00
Claude 14acc5d42e Window frames in the style of V's Flatkit Aurorae theme, the classic frame as a setting
CI / test (push) Canceled after 52s
The default frame now follows codegod100/kde aurorae (Flatkit / Flatkit Dark): the kit's
neutral title bar, a 1px outline with 10px top corners, a hairline under the title, a soft
16px shadow all round, a centred title and 24px flat buttons with hover and pressed fills
(close turns red). 38px title bar, 1px border. Maximized: no shadow, square corners.

- scene: WindowStyle (frame sizes, button layout, hit test) and build_window_decoration;
  the shadow is part of the decoration ops, so the three rasterisers lost their own offset
  shadow and redraw 18px around a changed window.
- host: the frame size follows the style (work area, wm title-bar room, CSD client boxes,
  hit zones, screenshots); title-bar buttons track hover, show pressed, act on release.
- Settings > Session > Flat window frames (off: the old Breeze-like frame), saved as
  :window-style :breeze; an unknown value is logged.
- docs/window-frames.md; tests for both styles' pixels, button states and switching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hmKDDLLES2aBrrnPxT
2026-11-26 04:09:38 +00:00
Claude 2c2ce3f913 Face unlock window steps aside while Apply asks for the password
CI / test (push) Canceled after 3m23s
After Apply the window kept the keyboard and the pointer and its dimmed card
covered the screen, so a password dialog that isn't Chandra's own (another
polkit agent's window) couldn't be reached. While Apply waits, the window now
shows only a note at the top and takes no input. A refused or cancelled
password brings it back with the snaps and marks kept (chandra-face camera
restarts the camera instead of exiting) and says so.

Test: snaps, Enter, the password dialog gets typing (Space no longer snaps
underneath) and the Authenticate click, then the root step finishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
2026-11-26 04:05:11 +00:00
Claude f2b2618104 ci: cancel superseded runs (one CI run per ref)
CI / test (push) Failing after 7m59s
Three overlapping runs on 2026-11-26 starved the shared runner node of memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hm8CvtJYQBG6kVhtbZ
2026-11-26 03:55:37 +00:00
Claude 2960005139 Gamerig Library: its own smooth gradient backdrop under the glass by default
CI / test (push) Successful in 7m13s
The desktop wallpaper's logo showing through the cards looked like a glitch. Background
now offers Gradient (default: 4 px bands with faint amber and blue glows), Wallpaper and Solid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 03:29:54 +00:00
Claude 02c831576a Smoother on Xorg and Live Starfield: draw one frame ahead, cache a backdrop's unchanging start
CI / test (push) Successful in 2m33s
Tested on a Vast GTX 1650 rig (8-core Xeon E5-2620 v4, NVIDIA Xorg, --x11 --fullscreen):
GPU detection says hardware (nvidia), CHANDRA_RENDER=software switches.

- Frame pacing: at most one frame is drawn ahead of the output instead of waiting until the
  output is ready. Waiting serialised drawing with the X server's copy of the last frame; overview
  on Xorg went from 24-27 fps to 41-48 fps (before the first round: 16-17 fps).
- MoonBit host: a backdrop whose ops change every frame but begin the same (a desktop module:
  Live Starfield's sky and nebulae under moving stars) keeps that common start as cached pixels
  and draws only the rest over a copy of it. Starfield raster 13 -> 1.7 ms a frame and CPU 46% ->
  11% in the cloud; it no longer clears, redraws and re-saves the whole backdrop every frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkTQp5uN5FtwpzrXUA
2026-11-26 03:15:55 +00:00
Claude 1154437050 Gamerig Library: fit the screen without scrolling, draw over the wallpaper
CI / test (push) Successful in 2m32s
The grid picks the roomiest card density that fits (fewer description and hint lines, narrower
cards, then name and buttons only) before it would scroll. The module now draws over the
desktop wallpaper with glassy panels and cards; Background setting Wallpaper (default) or Solid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 03:14:18 +00:00
Claude f556df2f4b Gamerig Library: gamerig's game library as a Chandra desktop module
CI / test (push) Successful in 2m25s
- New desktop module gamerig-library (components/gamerig-library, logic in lib/gamelib): the
  layout of gamerig's web library (desktop/ui) in draw ops. Top bar with the Gamerig mark, app
  count and search; sidebar with categories and counts, running apps (switch to, stop) and rig
  status (GPU, display, audio); card grid with featured games two columns wide, icon tiles,
  category and status badges, description, install hint, Launch / Big Picture / Switch to / Stop.
  Typing filters, arrows + Enter launch, the wheel scrolls. Colours: follow desktop, dark, light.
- New game-library capability: tables 26-28 (status, games, launch modes), request 45, in the
  wasmer/wasmtime stub, the MoonBit wasmhost and the Rust host-wasm.
- compositor/shell/gamelib.mbt polls GET $GAMERIG_DESKTOP_API/api/state (default
  http://127.0.0.1:8091) every 2 s with curl on a socket and POSTs launch/stop/focus; a file://
  base reads a state file (tests).
- --desktop NAME picks what fills the desktop at start. scripts/gamerig-kiosk.sh now runs a
  hybrid kiosk with the library as the desktop (CHANDRA_KIOSK_MODE=strict for the old one).
- Tests: lib/gamelib, compositor/host/gamelib_test.mbt, a host-wasm test; docs/gamerig-library.md
  with a screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:57:07 +00:00
Claude fa932f9ac0 GTK windows (Gajim, GNOME apps) resize from their shadow and all four edges
CI / test (push) Successful in 3m44s
GTK draws no border, only a shadow, and resizes only from a press in that
shadow, which Chandra never hands to the client. Chandra's own zones were
~4px wide around the visible edge and there was none on the top edge, so
Gajim (GTK 4) looked unresizable. Client-decorated windows now get zones
that reach up to 12px into the shadow (GTK's own handle size, at least 6px)
plus 3px over their edge, with 16px corners, top edge included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiu4r7mEXBdKY6cgv6
2026-11-26 02:48:22 +00:00
Claude b4f7149c72 Kiosk: --kiosk-hybrid keeps the desktop and locks only leaving the session
CI / test (push) Successful in 3m49s
Panel, launcher, dock, desktop module and shortcuts stay; Log out and power
actions are refused while locked. Admin escape and chandra-ctl kiosk work as
in the strict kiosk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:38:02 +00:00
Claude f0c39757d7 GTK 3 windows get Chandra's frame: org_kde_kwin_server_decoration
CI / test (push) Successful in 12m52s
GTK 3 has no xdg-decoration support, so every GTK 3 window without its own
header bar (Webby, Nemo-style apps) drew GTK's fallback title bar: a centered
title, only a close button, and a dark border inside Chandra's CSD box.
GTK 3 asks for server-side decoration through KWin's
org_kde_kwin_server_decoration instead. Chandra now advertises it with
default mode Server; request_mode(Client) (GTK 3 apps with a header bar)
keeps their own frame.

The Settings portal also answers org.gnome.desktop.wm.preferences
button-layout "appmenu:minimize,maximize,close", so apps that still draw
their own title bar show the same three buttons as Chandra's frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hghaEWWsCBgEq6iZHj
2026-11-26 02:37:48 +00:00
Claude 63ce79fa7c Drop pkg.generated.mbti files the test run left in the last commit
CI / test (push) Successful in 12m25s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
2026-11-26 02:36:40 +00:00
Claude 9f7489cfea Face unlock window: live camera preview, Snap, thumbnails, one password on Apply
CI / test (push) Failing after 12m30s
Settings > Session "Add or remove faces…" (and "Remove…" on a face) opens a
compositor-drawn Face unlock window instead of running root steps one by one:

- chandra-face camera runs as the user (no password): it streams a small live
  picture with the face box and a cropped thumbnail per snap; the snaps'
  embeddings stay in that process, nothing is written to disk.
- Click a snap to drop it; mark saved faces Remove/Keep.
- Apply saves the snaps as one face and removes the marked ones in one root
  `chandra-face apply` (JSON on stdin, validated) through run0/pkexec: one
  password prompt.
- New raster host function image-pixels (host-wasm, wasmhost, native) for the
  window's pictures.

Tests: camera session and apply in face/test_face.py; the window end to end
against a fake tool in compositor/host/face_test.mbt. Docs explain why the
change itself still needs root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
2026-11-26 02:36:29 +00:00
Claude 0a9787ae36 Chrome's own frame: honor zxdg_toplevel_decoration_v1.set_mode(client_side)
CI / test (push) Successful in 2m18s
Chrome with "Use system title bar and borders" off, and its installed web apps (PWAs), ask
for client-side decoration. Chandra always answered server-side, and Chrome kept drawing its
own title bar and shadow anyway (window geometry 10px in), so Chandra's title bar showed above
Chrome's with Chrome's shadow as a gap. Now a client asking for client_side gets it and is
framed like a GTK window (ToplevelFrame client_side); unset_mode or server_side keep Chandra's
frame. Checked with Chromium 158 on Ozone Wayland, headless. Test in csd_test.mbt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkfW5ttNd831XmdsC5
2026-11-26 02:27:05 +00:00
Claude 81cb8f9a1c docs: gamerig kiosk revisited on Xorg: Chandra as an X client, go
CI / test (push) Successful in 2m38s
Chandra runs as gamerig's library window on its NVIDIA Xorg; games, Selkies
and server.py stay as they are, so dmabuf/Xwayland are no longer needed. Gap
list, size (Chandra package 12 MiB gz measured), staged plan, test status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:24:36 +00:00
Claude d521d0d840 Kiosk mode: --kiosk CMD runs one fullscreen app, locked down, restarted when it exits
CI / test (push) Successful in 4m10s
No panel, no compositor shortcuts or desktop menus, the focused window
fullscreen (dialogs float), CMD restarted with backoff. Ctrl+Alt+Shift+Escape
or chandra-ctl kiosk lock|unlock|status for admin work. --app-id sets the X11
WM_CLASS / Wayland app id of Chandra's own window. scripts/gamerig-kiosk.sh
runs Chandra as a gamerig rig's library window on its NVIDIA Xorg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:22:03 +00:00
Claude 4920f505e5 dock test: don't expect LibreOffice's catalog name (CI has no .desktop for it)
CI / test (push) Successful in 2m18s
The menu title is the app's catalog name, which is just the id on a machine
without libreoffice-writer.desktop. The window rows check is enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
2026-11-26 02:19:19 +00:00
Claude e184e29600 X11 backend: ignore a stale _NET_SUPPORTING_WM_CHECK; tested on NVIDIA Xorg
CI / test (push) Failing after 2m3s
A window manager that was killed leaves the property on the root window,
so Chandra opened a 1280x720 window instead of taking the screen (seen on
a Vast.ai NVIDIA rig after pkill -9 openbox). Check that the window it
names exists and points at itself, as EWMH says. docs/x11.md records the
NVIDIA test (GTX 1650, driver 595.91.07).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
2026-11-26 01:59:17 +00:00
Claude ae48cc5bf4 Applications menu and Icon Desktop: show each app's .desktop icon
CI / test (push) Failing after 2m56s
The launcher's rows drew a letter circle and the Icon Desktop fell back to
letter tiles for every app that wasn't in the dock: the shell only published
icons for windows' and dock apps. publish_icons now also covers the rows the
open Applications menu lists (only those, so opening it looks up a handful of
icons) and every catalog app when the desktop module imports icons. Lookups
are the dock's (theme chain, absolute Icon= paths, PNG on the native host,
SVG too on the wasm host, generic app icon, then the letter tile) and cached
per id; an unchanged icons table is no longer re-sent every frame.

launcher-widget imports icons; the JS host has an icons stub (always 0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkhaM5djqPXPQNs7QR
2026-11-26 01:56:01 +00:00
Claude 71f0b858d6 Smoother animations without a GPU: faster rasteriser, frame pacing, software/hardware mode
CI / test (push) Failing after 3m2s
Measured headless at 1920x1080 with CHANDRA_FRAME_TRACE (new: one log line per drawn frame):
- Overview open: 46 -> 62 fps, worst frame gap 69 -> 36 ms, raster 14 -> 5 ms a frame.
- Live Starfield: 19 -> 30 fps (its target), raster 49 -> 13 ms, CPU 97% -> 46%.

Rasteriser (MoonBit host; circles and previews also in the Rust host):
- Blending works on two channels at a time in 16-bit lanes with an exact /255: same pixels,
  about 3x quicker on big translucent fills (the overview's dim, the starfield's nebulae).
- Filled circles are drawn as row spans, rings skip their empty middle (a sqrt per pixel of the
  bounding box before). Same pixels; a Rust test checks it against the old loop.
- Window previews gliding in the overview are sampled straight from the preview at each frame's
  size instead of filtered and cached at a size used once; the MoonBit host also gets the
  one-large-size cache and 4096 px draw limit the Rust host had (it kept every size and didn't
  draw previews past 1024 px).
- Image scaling sums each output row's columns once, with 32-bit sums and division.

Frame pacing: frames are drawn only when the output can take them (no page flip in flight on
KMS; the previous frame shown nested and on X11), with a frame every 250 ms for an output that
never gets ready. The KMS loop runs at 125 Hz, so animations used to rasterise frames that were
never shown.

Software or hardware mode (compositor/shell/render_mode.mbt, docs/rendering.md): detected from
the DRM render nodes' drivers (and NVIDIA's proprietary driver, LIBGL_ALWAYS_SOFTWARE),
overridden by CHANDRA_RENDER=software|hardware or Settings > Session "Lighter animations"
(state.edn :render, saved only when it differs from what was detected). Software mode remakes
changing previews every 200 ms instead of 100 ms and caps desktop modules at ~30 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkTQp5uN5FtwpzrXUA
2026-11-26 01:55:50 +00:00
nandiandClaude Sonnet 5.5 1aabccba5d Face unlock: point at the webcam by its stable by-id path, not /dev/video0 (OBS virtual camera)
CI / test (push) Failing after 3m0s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjM4nPcLCbqchiA2V3
2026-11-25 17:54:26 -08:00
Claude 01bd8281d5 Dock: plain icons always come before the task pills
CI / test (push) Failing after 2m33s
With window titles on, a pinned app that was running drew as a pill in its
pin slot, so idle pinned icons ended up between pills. Now the dock shows
the pinned apps that aren't running first, then every task: running pinned
apps in pin order, then the other running apps. The divider sits between
the two groups. Squeezing the pills to icons keeps the order; with titles
off the plain pinned order stays. Move left / right in the menu follow the
pin list, not the shown position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
2026-11-26 01:53:43 +00:00
Claude 5403777451 Session: replace a Qt platform theme whose plugin isn't installed
CI / test (push) Successful in 2m10s
QT_QPA_PLATFORMTHEME=gnome left in the environment without QGnomePlatform
made Qt load no platform theme, so KF6 apps got a light Breeze palette
while the Breeze style and Dolphin's view read the dark kdeglobals colors:
Dolphin's rows alternated near-black (with dark text) and light.
chandra-session now keeps a preset theme only if its plugin exists for Qt 6
or 5, else picks kde / xdgdesktopportal as before. Reproduced and checked
with Dolphin 26.08 / Qt 6.11 / KF 6.32 headless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hivwxSsQ56aGGv4cFQ
2026-11-26 01:43:02 +00:00
Claude 3e35c4dfa5 One install recipe: just install installs everything
CI / test (push) Successful in 2m25s
just install now builds as you, then asks for root once and installs the
whole thing: the login session (wasm compositor on the MoonBit host,
modules, chandra-ctl, KDE colors, portal) and face unlock (helper, PAM
module, config, models). The alternatives are flags instead of recipes:
--link (was install-dev), --rust (install-rust), --native
(install-native), --pam (install-face --pam), --no-face, --no-models.
The PAM module is compiled as you into build/, so root only copies it;
without a compiler or libpam headers face unlock is skipped with a warning.
just uninstall removes face unlock too (--purge: enrolled faces).

Removed: install-dev, install-rust, install-native, install-face,
uninstall-face and the old install-session* / uninstall-session aliases.
New docs/install.md; README, docs and installer hints updated. Also drops
a committed __pycache__ file and ignores __pycache__/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkA52AocBmJHipFRqb
2026-11-26 01:38:58 +00:00
Claude e6be3825d0 X11 backend: run Chandra on Xorg (NVIDIA's proprietary driver)
CI / test (push) Successful in 2m28s
--x11 shows the desktop on the X server in $DISPLAY: a resizable window
under a window manager (--fullscreen asks it for fullscreen), or the whole
screen when no window manager runs, following xrandr resizes.

compositor/x11 is a pure X11 wire-protocol client (no libX11/xcb), so it
runs in the wasm compositor on both hosts and in the native build. Frames
go through MIT-SHM 1.2 (ShmAttachFd of the host frame memfd, paced by
ShmCompletion), with a core PutImage fallback. The keymap given to clients
is the X server's own (xkbcomp -xkb $DISPLAY -); X auto-repeat is dropped,
modifier/lock state comes from X's modifier map; MIT-MAGIC-COOKIE-1 auth.

chandra-session --x11 (and the new "Chandra (X11)" xsessions entry) runs
it as the login session; --login-session gives an X11 session what --drm
implied (power actions, polkit agent, system theme). just run-x11.
Docs: docs/x11.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
2026-11-26 01:37:49 +00:00