Commit Graph
74 Commits
Author SHA1 Message Date
nandi 74235cb0ca Add backlight control to the shell and regenerate WIT bindings
CI / test (push) Canceled after 0s
- Add compositor/shell/backlight.mbt for backlight control in the shell
- Update wit/capabilities.wit and wit/host/plasmoids.wit, then regenerate the component and interface ffi.mbt bindings (mostly export reordering)
- Add world/launcher-widget/README.md
2026-11-28 02:16:07 -08:00
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
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
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
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
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
nandiandClaude Sonnet 5.5 63e63c65e0 raster: don't zero the framebuffer when the cached backdrop is about to overwrite it
CI / test (push) Failing after 18s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 04:40:31 -08:00
nandiandClaude Sonnet 5.5 c6e31b4a8f Draw in the host: the wasm compositor sends draw ops, the host rasterises natively
CI / test (push) Failing after 29s
The wasm software renderer cost ~10-20 ns/pixel, so any changed frame took ~100+ ms at 1080p and
the desktop swung between idle and very slow. The compositor still builds the scene (windows,
decorations, panel, wallpaper) but a new moonplasma:host/raster interface turns it into pixels
in the host:
- host-wasm/src/raster.rs: a port of compositor/renderer (same blend arithmetic: fills, strokes,
  lines, circles, text, clips, shadows, surface blits), a wallpaper+desktop-card cache, and captured
  client surfaces (copied out of the shared memory once at commit, converted to RGBA, solid ones
  blit as row copies). 9 unit tests; a full frame matches the native software renderer except for
  text antialiasing (0.3% of pixels).
- compositor/raster sends a SceneGraph as ops; compositor.compose_scene() returns it only when
  something changed. The login session shows the host framebuffer directly (display.present-frame),
  the nested window gets it as a memfd (raster.export-memfd), --gfx-out reads it (read-frame).
- Client buffers never enter wasm: snapshot_shm_buffer captures in the host and keeps an id.
- Loop pacing sleeps the rest of the frame budget instead of a fixed 16/8 ms.
Full-screen terminal flooding output at 1080p: ~2 fps / 94% CPU -> ~57 fps; idle ~9%.
The native build keeps the software renderer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 04:39:40 -08:00
nandiandClaude Sonnet 5.5 66bf293085 Faster busy-client frames: read only the buffer's bytes, cache the wallpaper, cheaper strokes
CI / test (push) Failing after 18s
Profiling a full-screen terminal at 1080p (about 2 fps):
- snapshot_shm_buffer asked the host to copy the pool from byte 0 to the end of the buffer; foot
  puts its buffers deep in a ~135 MB pool, so every commit moved ~135 MB (~185 ms). New
  sys.mmap-read-at(fd, offset, len) copies just the buffer: step 200 ms -> 5 ms per frame.
- The wallpaper (gradient + discs) is rendered once and copied back each frame while unchanged;
  it is split from the desktop card, which changes every second.
- stroke_rounded_rect walked every pixel of the window to draw a 1px outline; it now only
  draws the border strips (exact per-pixel path kept for the corner bands).
- Window shadows only blend the strips that stick out from under the window.
Rasteriser: ~256 ms -> ~93 ms per full-screen frame. Tests compare strokes and fills with the
old per-pixel code, and check the wallpaper cache.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 04:01:25 -08:00
nandiandClaude Sonnet 5.5 70ad87f2d2 Task manager panel module and Alt+Tab window switcher
CI / test (push) Failing after 18s
- components/tasks: the 'tasks' module the panel and components.txt already named but whose source
  was missing. One pill per window in opening order (stable, not stacking order), focused lit,
  minimized dimmed, hover, titles shortened, pills shrink to fit; click focuses/restores.
  Tests that loaded it (task list, title-bar minimize/restore) pass again.
- compositor/host/switcher.mbt: hold Alt, press Tab: most-recently-used window list with the
  previous window selected; Tab/Shift+Tab/arrows move, releasing Alt switches (restoring a
  minimized window), Escape cancels. Tab is not forwarded to clients.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 03:39:19 -08:00
nandiandClaude Sonnet 5.5 095bbc5906 Stop redrawing an unchanged desktop; faster fills and blits; --profile
CI / test (push) Failing after 31s
Profiling the wasm compositor at 1080p idle: ~90 ms per frame in the software rasteriser, run
every loop iteration (92% of a core, stuttery). Now:
- compose_frame compares what the frame is made from (shell ops, decorations, popups, client
  damage) with the last one and returns the previous pixels when nothing changed; the DRM and
  nested loops only present a changed frame (held until the display is ready).
- fill_rounded_rect fills spans (circle test only in the corner bands) and blit_shm_surface
  copies rows without per-pixel calls; tests check both against the old per-pixel code.
- snapshot_shm_buffer sliced buffers byte by byte; now a slice copy.
- --profile prints per-3s step / shell / raster timings.
Idle CPU at 1080p: 92% -> ~10%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 03:35:06 -08:00
nandiandClaude Sonnet 5.5 235f17cd70 Remember window positions in state.edn, per app
CI / test (push) Failing after 37s
:windows {"app.id" {:x :y :w :h}} is written when a floating window is dragged or resized and
read at startup; an app opening later gets its last place (floating, clamped on screen).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 03:14:58 -08:00
nandiandClaude Sonnet 5.5 4b99b0063e Clicking a window raises it: go through the WM's Activate so stacking order changes
CI / test (push) Failing after 34s
Window clicks, title-bar drags, resize grabs and focus handoff after close emitted Focus/Raise
directly; Raise only marked damage, so the WM's floating order never changed and a focused
window could stay drawn under another. They now use handle_request(Activate) (activate_window).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 03:11:58 -08:00
nandiandClaude Sonnet 5.5 69a163bc08 Persist the desktop card position in state.edn
CI / test (push) Failing after 16s
:desktop-card {:x N :y N} is written when the card is dropped (and kept on later saves),
and restored at startup; the existing clamp keeps it on screen if the resolution changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:59:38 -08:00
nandiandClaude Sonnet 5.5 61796b9f69 Ignore the generated package interfaces that were never committed
CI / test (push) Failing after 33s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:53:51 -08:00
nandiandClaude Sonnet 5.5 b50e79acaa Save the layout mode and recent apps as EDN (state.edn) and restore them at startup
CI / test (push) Failing after 30s
state.edn sits next to panel.edn in $XDG_CONFIG_HOME/moon-plasma: {:layout :tiling|:monocle|:floating
:recent [...]}. It is written whenever the layout changes (the Tile | Float switcher, or anything else)
or an app is launched, and read at startup by both the native and wasm compositors. Saving merges
into the existing file, so keys this build doesn't know survive; unreadable files are ignored. Uses
jqlssg/moonedn for reading and writing. The launcher's recents used to live in a plain-text file under
~/.cache; they are migrated once when there is no state.edn yet. The Interface Explorer toggle is
deliberately not restored (while on, clicks don't reach windows).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:52:07 -08:00
nandiandClaude Sonnet 5.5 0ba975da67 Logout button for the session, and a dev install that symlinks into the checkout
CI / test (push) Failing after 28s
- New 'session' capability (wit/capabilities.wit) and 'logout' panel module: a button whose popup
  asks 'Log out | Cancel' (Enter confirms, Escape cancels). Confirming makes the compositor exit,
  which ends the login session; works in the wasm host and the native build. In the default panel.
- session/install.py --link (just install-session-dev): symlink the host, component, modules,
  fonts and config into this checkout, so after one root install a rebuild is just
  'just compositor-wasm host-wasm modules' for the next login. Plain installs still copy.
- Tests: host runtime test for the module, native end-to-end test (click, cancel, confirm).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:44:44 -08:00
nandiandClaude Sonnet 5.5 c03d4c6c17 The wasm compositor as a login session: DRM/KMS + libinput through the host
CI / test (push) Failing after 1m13s
New moonplasma:host/display import (open, poll, present, cursor, input events, close). The
wasmtime host implements it by compiling the compositor's own kms shim (libseat + DRM/KMS +
libinput + xkbcommon) via build.rs (feature drm, default on), so the native and wasm backends
share one implementation. compositor/kms gets a wasm backend with the same API, and the shared
app loop gains --drm.

- session: install.py installs the host, compositor.wasm, fonts, config, wit and modules and the
  display-manager entry (--native keeps the old native session); the launcher starts the host
  when installed. just run-drm / install-session use the wasm compositor; *-native keep the old.
- compositor.wasm moves to build/ (out of build/components, where the module catalog scans).

Verified: component builds with the new import, host instantiates it and renders frames, installed
layout (fonts/modules/theme from the share dir) renders correctly in a sandbox, native build and
tests unchanged. NOT exercised on a real login VT.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:38:19 -08:00
nandiandClaude Sonnet 5.5 95b7275b3a Spike: compositor session state as EDN (jqlssg/moonedn)
CI / test (push) Failing after 16s
compositor/session round-trips a toy snapshot of server state (counters, clients, toplevels) through
EDN and edits one field by path: groundwork for persisting compositor state across a component swap.
Adds the jqlssg/moonedn dependency. Builds and passes on native and wasm.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:18:36 -08:00
nandiandClaude Sonnet 5.5 e769566d8f Panel modules in the wasm compositor: the host runs them (moonplasma:host/plasmoids)
CI / test (push) Failing after 46s
A component can't embed a second wasm runtime, so the compositor drives panel modules through a
host import and the wasmtime host instantiates them: load, render, popup, on-event, plus the data
they read (apps, windows, layouts, modules, system) and the requests they make (launch, focus
window, set layout, load/unload, browse), with a zenity file chooser for 'Add widget'.

- wit/worlds.wit: world plasmoid-host, every capability a module can import + the plasmoid export.
  The host instantiates any module against it; a module imports the subset it uses.
- wit/host/plasmoids.wit + generated MoonBit bindings; compositor/wasm gets a wasm backend
  (wasm_host.mbt) with the same public API as the native wasmer one.
- host-wasm/src/plasmoid.rs: typed component bindings, one Store per module, shared host data.
  Tests load the built launcher/layout modules and drive them (typed filter, Enter, launch request).
- scripts/gen-native-stubs.py keeps a package's imports when it rewrites moon.pkg.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 02:09:57 -08:00
nandiandClaude Sonnet 5.5 5c3bebc7fd Real fonts in the wasm compositor: the host rasterises glyphs (Allo Variable, Adwaita Mono)
CI / test (push) Failing after 27s
New moonplasma:host/font import (load a TTF into a slot, rasterise a glyph). compositor/font now
shares its loading/caching/install logic and has two backends: stb_truetype through C (native) and
the host import (wasm). The Rust host draws glyphs with ab_glyph's outlines on an integer pixel grid,
using stb_truetype's em-size scaling, so text matches the native build.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:50:01 -08:00
nandiandClaude Sonnet 5.5 0b9af11232 Focus and raise windows through the WM's Activate request
CI / test (push) Failing after 16s
A click on a window and a task-list click now go through WmState::handle_request(Activate)
instead of emitting Focus/Raise directly, so the window manager's own focus and stacking state
stays in step with what the compositor shows. Also refreshes scene's generated interface
(SceneGraph.popups).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:46:25 -08:00
nandiandClaude Sonnet 5.5 4ff933ce54 just run now runs the wasm compositor; the native one is just run-native
CI / test (push) Failing after 18s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:43:55 -08:00
nandiandClaude Sonnet 5.5 6aba9b6a4f Compile the compositor to a wasm component, run by a small wasmtime host
CI / test (push) Failing after 22s
The whole compositor (Wayland server, window manager, scene, rasteriser, shell) now builds as
build/components/compositor.wasm: a component that imports only moonplasma:host/sys
(wit/host/sys.wit: sockets + SCM_RIGHTS, memfd, poll, spawn, files, clock) and exports run().
host-wasm/ is the native side: a wasmtime program implementing that interface with libc.

- compositor/sys: per-target backends (sys_native.mbt over the C shim, sys_wasm.mbt over the WIT
  imports) behind one API; wayland/nested/host/shell/scene/renderer/gfx build for wasm unchanged.
- compositor/app: the entry point (arg parsing + main loop) as a library for both targets;
  --serve keeps refreshing a PNG so a live compositor can be inspected without a display.
- compositor/font, compositor/wasm: wasm-side placeholders (bitmap font; no panel modules yet,
  since a component can't embed a second wasm runtime: that becomes a host import).
- scripts/gen-native-stubs.py: native stand-ins for wasm-only generated imports.
- just compositor-wasm / host-wasm / run-wasm.

Verified: foot connects to the component's socket and renders into it; native build and
tests unchanged (16/23, the same 7 need unbuilt panel modules).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:41:31 -08:00
nandiandClaude Sonnet 5.5 92d2b29889 just build no longer builds tcc: use $TCC, an already-built vendored tcc, or tcc on PATH
CI / test (push) Failing after 35s
scripts/tcc/tcc resolves the compiler (and errors with how to get one if none exists);
tcc-build stays as an optional recipe. bench no longer depends on it either.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:27:00 -08:00
nandiandClaude Sonnet 5.5 1bbdf58372 justfile: add clean (keeps the built tinycc) and clean-all
CI / test (push) Failing after 10m34s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:24:31 -08:00
nandiandClaude Sonnet 5.5 a0872c9b40 just bench: time the native build (cold / warm / one-file edit), tcc vs system cc
CI / test (push) Failing after 11m6s
scripts/bench-build.sh copies the sources to a temp dir with its own target dir, so it
never touches _build/ or files being edited. just bench [runs] ["tcc cc cc-release"].

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 01:13:05 -08:00
nandi 69a1a0738c Merge commits a9417fbccf
CI / test (push) Failing after 28s
2026-11-25 01:04:11 -08:00
nandiandClaude Sonnet 5.5 a9417fbccf Resize floating windows by dragging their corners and side edges
CI / test (push) Failing after 15s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:44:34 -08:00
nandiandClaude Sonnet 5.5 8a3ea16b1c Drag windows by their title bar
CI / test (push) Failing after 17s
A press on a title bar (outside the buttons) focuses the window, floats it if it was
tiled (WmState::float_window) and starts a move drag; motion moves it, release ends it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:42:38 -08:00
nandiandClaude Sonnet 5.5 306a7c121e Clipboard: implement wl_data_device selection (copy/paste between clients)
The data-device manager was accepted but ignored. Now set_selection is tracked,
the focused client is offered the selection (data_offer/offer/selection) on focus
change and on update, receive() forwards the fd to the owner as source.send, and
the selection is cleared when its owner goes away. Drag-and-drop is still unsupported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:41:44 -08:00
nandiandClaude Sonnet 5.5 f05677178a Panel hover events for modules; spawned apps get default SIGCHLD and keep the real bus for flatpak
CI / test (push) Failing after 16s
- shell: the module under the pointer gets PointerMove, the one it left gets PointerLeave
  (hover feedback, e.g. the dock's magnifying tiles)
- sys: reset SIGCHLD to SIG_DFL in the child before exec (SIG_IGN is inherited and breaks
  apps that wait() on helpers, e.g. terminals); flatpak run keeps the real session bus
- inspector: drop the redundant 'scroll for more' hint next to the scrollbar

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:41:07 -08:00
nandiandClaude Sonnet 5.5 95a21a0b84 Add layout module: Tile | Float toggle widget for the panel
CI / test (push) Failing after 1m5s
Two-segment switch over the layout-control capability: click flips tiling <-> floating
(monocle goes to floating). Includes generated bindings and an updated wasm test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:39:32 -08:00
nandiandClaude Sonnet 5.5 82cac8a915 wl_shm: keep a buffer valid after its pool is destroyed
CI / test (push) Failing after 18s
Qt Quick apps (kwi) render through Mesa's software EGL path, which creates a pool,
creates one buffer and destroys the pool at once. We closed the fd and dropped the
pool, so every snapshot returned None and the window stayed blank. The pool now lives
until its last buffer is destroyed (re-keyed so recycled client ids can't collide).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:24:33 -08:00
nandiandClaude Sonnet 5.5 df1f37ee78 Inspector popup: show module file name and clip the note to the popup width
CI / test (push) Failing after 28s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:16:27 -08:00
nandiandClaude Sonnet 5.5 6fc921b431 Add dock module: dock-style quick launcher with magnifying app tiles
CI / test (push) Failing after 23s
- lib/dock: tile layout, hit-testing, magnification, per-app colours (tested)
- components/dock: plasmoid module (imports only app-catalog + app-launch)
- shell: panel widgets now get pointer-move / pointer-leave while hovered

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:14:29 -08:00
nandi 79321790a1 Merge branch 'main' of https://git.site.latha.org/experiments/moon-plasma
CI / test (push) Failing after 20s
2026-11-25 00:10:16 -08:00
nandiandClaude Sonnet 5.5 bf07af2c43 Add the inspector panel module (Interface Explorer toggle): source and bindings
components.txt listed it but no source existed, so the panel had no Interface
Explorer button. Panel button that toggles the shell's inspect mode via the
inspector capability.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:10:11 -08:00
nandiandClaude Sonnet 5.5 bc1e3dfdbd xdg_popup support: right-click menus in client apps (Konsole etc.)
CI / test (push) Failing after 37s
- server: xdg_positioner state, get_popup placement + configure, popup commits,
  popup_done; popups share the toplevel table so pointer/keyboard routing is reused
- compositor: popups drawn above windows and panel, input goes to the popup under the
  pointer, keyboard focus follows the popup, a click outside dismisses them
- test: a client opens a popup, clicks inside it, and is told to dismiss it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 00:03:49 -08:00
nandi 3b2e19ace5 Merge commits bca69d8c90
CI / test (push) Failing after 54s
2026-11-24 23:47:09 -08:00
nandiandClaude Sonnet 5.5 200b02d0f1 Add the module-manager panel module (source, bindings)
CI / test (push) Failing after 15s
components.txt listed it but no source existed, so just modules skipped it and the
picker said 'Module manager not found'. Panel button + popup: loaded instances
(click to unload), available modules (click to load), Browse...

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 23:42:50 -08:00
nandiandClaude Sonnet 5.5 bca69d8c90 Desktop card: click and drag it around the wallpaper
Press on the card (when no window covers it) to grab it; it follows the pointer,
clamped to the screen, with a hand cursor on hover and grabbing while dragged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 23:41:31 -08:00
nandiandClaude Sonnet 5.5 8724805a72 Right-click Replace only offers modules of the same kind (same WIT world)
CI / test (push) Failing after 16s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 23:41:07 -08:00
nandiandClaude Sonnet 5.5 783618b89f build-modules: skip modules whose source isn't in the tree instead of failing
CI / test (push) Failing after 29s
just run depends on just modules; a component listed in components.txt without a
built core module (pulse, tasks, layout, ...) aborted the whole build. It now warns
and carries on, so the panel loads whichever modules do exist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 23:38:40 -08:00
nandiandClaude Sonnet 5.5 0145981c6a Wasm panel modules, widget host, merged plasmoid host design, and shell/UI work
Panel and wasm host
- The panel is built from wasm plasmoid modules (compositor/wasm: wasmer-backed host).
  Modules get capabilities by importing host interfaces; the host publishes data tables
  and serves a request queue (launch, focus window, set layout, inspector, load/unload
  modules). New WIT: windows, layout-control, inspector, modules, system.
- Merged two competing host designs: generic tables + requests are the base; the
  `system` snapshot and the id-stable `windows.all/focus` (Desktop Pulse) run on top of it.
- Panel widgets: load a .wasm from a path or file chooser, reorder by dragging,
  right-click replace/remove/add, saved to panel.edn.
- Desktop widget, system sampler (sysinfo), app catalog/humanised names, Interface
  Explorer (inspector), real font rendering (compositor/font, assets/fonts).

Compositor
- Drag the divider between tiled windows; lower tiled rows leave room for the title bar.
- Title-bar buttons, 12-hour clock, truncated titles, task-list/layout menus.
- DRM/KMS session, tcc debug builds (vendored tinycc incl. conftest.c), justfile
  recipes (modules, run, test), pixi.toml.

Known gaps
- The sources for the pulse, tasks, layout, inspector, module-manager, moon-* and
  clock-digital12 modules are not in the tree yet, so `just modules` stops at pulse and
  the host tests that load those modules fail until they land.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 23:38:05 -08:00
nandiandClaude Sonnet 5.5 080377fd79 Wayland: decode UTF-8 strings from clients (titles like 'Session Chooser — Kate' showed as mojibake)
CI / test (push) Failing after 38s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 22:08:34 -08:00
nandiandClaude Sonnet 5.5 50442a7e30 Vendor tinycc's conftest.c (ignored by tinycc's own .gitignore, so ./configure failed)
CI / test (push) Failing after 39s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 21:20:28 -08:00
nandiandClaude Sonnet 5.5 b2557aca52 DRM/KMS + libinput backend and a Moon Plasma login session
compositor/kms: libseat (device access, VT switching), DRM dumb buffers with page
flips and a hardware cursor, libinput keyboard/pointer, xkbcommon keymap and
modifiers. --drm runs the compositor on the real display at the monitor's native
mode. session/ holds the display-manager entry, launcher script and installer
(just install-session). Untested on hardware: refuses to start inside another
session.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:59:54 -08:00
nandiandClaude Sonnet 5.5 5b32cf9808 Interface Explorer: compact dialog (14 rows) with mouse-wheel scrolling and scrollbar
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:58:06 -08:00
nandiandClaude Sonnet 5.5 7a37039673 Vendor tinycc and build the compositor in debug with it (just build/run)
CI / test (push) Successful in 38s
moon adds -DMOONBIT_NATIVE_NO_SYS_HEADER whenever the C compiler is tcc, which
compiles the system runtime out and breaks linking a standalone exe; the
scripts/tcc/tcc wrapper drops that flag. just tcc-build builds third_party/tinycc
into _build/tcc; build-release keeps the optimised system-cc build.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:53:51 -08:00
nandi 49e91b4c01 Merge branch 'main' of https://git.site.latha.org/experiments/moon-plasma
CI / test (push) Successful in 39s
2026-11-24 20:21:54 -08:00
nandiandClaude Sonnet 5.5 57d5376211 Fix launcher search: key_name returned code-unit numbers instead of characters
String indexing yields a UTF-16 code unit, so 'a' became "97" and the launcher
rejected it. Convert to Char first; the input test now types into the search.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:21:46 -08:00
nandiandClaude Sonnet 5.5 7154312919 Drag the divider between tiled windows to resize them
CI / test (push) Successful in 37s
- lib/wm: split handles, drag_split, vertical rows now leave room for the lower
  window's title bar (fixes overlapping title bars)
- compositor: pointer press/move/release on a divider resizes the split, with an
  ew/ns-resize cursor; button releases are only forwarded after a forwarded press

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:12:13 -08:00
nandiandClaude Sonnet 5.5 ee698c9846 Decorations: truncate window titles so they never draw over the title-bar buttons
CI / test (push) Successful in 25s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:08:58 -08:00
nandiandClaude Sonnet 5.5 9e7687bea8 Panel: truncate task-button titles to fit their pill
CI / test (push) Successful in 38s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:06:53 -08:00
nandiandClaude Sonnet 5.5 9b31a7c476 Renderer: add punctuation glyphs (~ @ ( ) etc.) to the bitmap font
CI / test (push) Successful in 25s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:53:50 -08:00
nandiandClaude Sonnet 5.5 abdc5de8e3 Reserve title-bar height at the top of the work area so tiled windows' title bars aren't cut off
CI / test (push) Successful in 28s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:52:29 -08:00
nandiandClaude Sonnet 5.5 59ea224d38 12-hour clock and hover-dependent cursor
CI / test (push) Successful in 45s
- timefmt.hhmm12 + render_digital(hour12=); compositor panel shows '7:51 PM'
  (wasm clock component keeps 24h by default)
- wp_cursor_shape_v1: server lets clients pick their cursor; nested window
  forwards the shape to the host. Launcher button/entries show a hand, the
  search field a text cursor, client windows what the client asked for.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:51:16 -08:00
nandiandClaude Sonnet 5.5 a63f65806d Make the desktop interactive: pointer/keyboard routing, launcher popup, app launching
CI / test (push) Successful in 25s
- server: wl_pointer/wl_keyboard events (enter/leave/motion/button/key/modifiers),
  host keymap shared with client keyboards
- nested: receives host pointer + keyboard + keymap, queues InputEvents
- host: routes input to the launcher popup or the window under the pointer;
  click-to-focus moves keyboard focus
- shell: launcher button opens lib/launcher popup; entries start real apps
  (foot, konsole, dolphin, firefox, kate, systemsettings if installed) with
  WAYLAND_DISPLAY pointed at the compositor
- sys: has_exe + spawn
- e2e test for input delivery and the launcher popup

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:11:15 -08:00
nandiandClaude Sonnet 5.5 a1b85474f8 Nested window backend: run the compositor in a window on the host Wayland session
CI / test (push) Successful in 26s
The compositor opens an xdg_toplevel on $WAYLAND_DISPLAY, presents frames via
wl_shm with frame-callback pacing and forwards host pointer input to the gfx
surface. just run now uses it (release build); run-headless keeps the old mode.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:06:51 -08:00
nandiandClaude Sonnet 5.5 a265eebf02 justfile: add view recipe (one-frame PNG snapshot)
CI / test (push) Successful in 42s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 19:04:24 -08:00
nandiandClaude Sonnet 5.5 ccb809bdc3 Add justfile with build, run, client, test, frame, ci recipes
CI / test (push) Successful in 24s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 18:51:22 -08:00
nandiandClaude Sonnet 5.5 769ab829c8 Load the real desktop shell (lib/shell, panel, launcher, clock) into the native compositor
CI / test (push) Successful in 34s
Replaces the hardcoded build_shell_ops with compositor/shell, which drives the
same pure lib/* logic the wasm components wrap and adapts it to scene ops.
Adds a wall-clock FFI and native stubs for the wasm-only theme bindings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 18:48:34 -08:00
nandiandClaude Sonnet 5.5 3cb8417699 Compositor: advertise wl_subcompositor and wl_data_device_manager so real clients (foot) load
CI / test (push) Successful in 59s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 18:40:24 -08:00
nandi 880ecd4102 M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s
2026-11-24 23:51:26 +00:00
nandi e5548fc067 Initial commit 2026-11-24 23:14:29 +00:00