Commit Graph
57 Commits
Author SHA1 Message Date
Claude 0e6a1257e1 Settings module: Session, Desktop and Panel tabs; the module manager moves in
CI / test (push) Failing after 15s
- The settings popup gets a tab bar, split by where things live: Session (the switches), Desktop
  (what is drawn on the desktop: the wallpaper list under a "Wallpaper" heading) and Panel (what
  the module manager showed: modules in the panel to remove, modules to add, Browse...).
  Left/Right or 1/2/3 switch tabs; it reopens on the tab it was left on. Modules can't be placed
  on the desktop yet (every wasm module lives in the panel; the desktop card is built in), so
  the Desktop tab has no module section until they can.
- The standalone module-manager module and its world are removed; the settings module imports
  `modules`. Saved panels listing "module-manager" get the settings module in its place.
- DesktopShell::open_settings(SettingsTab) opens the settings module on a tab (loading it into the
  panel if needed), for the panel menu and "System settings" entries; the wasm picker
  ("Modules..." in the panel menu) is open_settings(Panel).
- Tests: the native picker test drives the Panel tab, the wallpaper and switch tests go through
  the tabs, an open_settings test; the wasm and host-wasm module tests use the settings module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
2026-11-25 18:50:57 +00:00
Claude ee019ecbaa Settings module: the wallpaper chooser moves in, and a Dark mode switch
CI / test (push) Failing after 16s
- The session settings module becomes the panel's "Settings" button. Its popup lists the session
  switches, then a "Wallpaper" heading and the wallpapers (current one ticked); a click on a
  wallpaper shows it at once, as the old chooser did. Up/Down skip the heading.
- The standalone wallpaper module and its world are removed. A saved panel.edn that lists
  "wallpaper" gets the settings module in its place (or just drops it when Settings is there).
- New "Dark mode" setting (on by default). Off swaps the compositor to the Moon Day palette
  (ThemeTokens::moon_day, the values of config/themes/moon-day.json) for the shell, panel modules,
  window decorations and the switcher; on goes back to the configured theme. Saved in state.edn
  as :theme :light (absent or :dark: dark) and applied at startup by restore_state.
- Tests: the native wallpaper test drives the settings module, the settings test flips Dark mode
  and checks the theme, the state.edn round trip covers :theme, panel migration unit test, and
  the host-wasm test covers the switches and the wallpaper rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
2026-11-25 18:46:25 +00:00
Claude a0b878af23 Session settings panel module: switch session restore and window placement on or off
CI / test (push) Failing after 16s
- New 'session-settings' capability (wit/capabilities.wit: settings, is-on, set-setting) and
  'session-settings' panel module: a "Session" button whose popup lists the session settings,
  each with an on/off switch. Clicking a row flips it at once (the list stays open); Up/Down move
  the highlight, Enter or Space flips it, Escape or a click elsewhere closes. In the default
  panel, between Wallpaper and Log out.
- Two settings to start with, kept in state.edn and written only when off (absent means on):
  "Reopen windows at login" (:restore-session, the key session restore already read) and
  "Remember window positions" (:remember-windows; when off, floating windows aren't placed where
  their app was left and new places aren't recorded, but the saved ones are kept).
- Served by both hosts: wasmer stub (native; settings table 6, bit mask in host int 3,
  requests 10/11) and host-wasm (publish-session-settings, set-session-setting request).
- Tests: native end-to-end (open, click both rows, keyboard, Escape), a state.edn round trip
  that checks both settings take effect, and a host-wasm module test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
2026-11-25 18:43:27 +00:00
Claude c169489d44 Desktop Pulse: drop the task icons
CI / test (push) Failing after 31s
Pulse no longer draws a chip (a lettered tile) per open window at the end
of its row, and clicking there no longer raises a window. Its machine
stats are unchanged.

Pulse's source is not in the tree, so this patches the prebuilt
component: the chip loop in render now runs zero times (its bound, the
window count, is replaced with 0). The task manager and dock icons are
untouched.

The Pulse test now checks that clicking where the chips were focuses
nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhrN6hviAdUbcZrRTM
2026-11-25 18:43:09 +00:00
Claude 9a25d70f77 Task manager: show an app icon on each window's pill
CI / test (push) Failing after 18s
Each pill now starts with the app's icon: the same coloured tile with a
letter that the dock draws for that app id, so an app looks the same in
both. The app id comes from windows.all (the task-bar rows carry only
titles); windows without one fall back to a title-keyed tile. Pills
narrower than 72px show just the centred icon.

The tile drawing moves into lib/dock (app_icon, app_glyph) and the dock
uses it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hm1XqzhrA4N8FyhuRa
2026-11-25 18:31:41 +00:00
Claude 46780c399b Restore the session on login: reopen the windows the last session ended with
CI / test (push) Failing after 20s
- state.edn gets :session [{:app "foot"} {:app "org.gnome.Nautilus" :minimized true}]: the open
  windows by app id, in opening order, with whether each was minimized or maximized. Dialogs
  (xdg_toplevel.set_parent, now tracked by the Wayland server) are left out.
- Written at the end of a session (logout, or the display/window going away) and, against
  crashes, whenever the set of windows changes and then holds for 3 s; that delay also keeps a
  shutdown, where apps die a moment before the compositor, from saving an empty desktop.
- At start (both the native binary and the wasm compositor) each saved app is launched through
  its .desktop file: the app id is matched to the desktop file id, StartupWMClass (now parsed),
  case-insensitively, or by its last dotted part. Restored apps don't count as recent launches.
  A launched app stays in the session until its window shows up (30 s at most), and that window
  gets its minimized/maximized state back; placement is the existing layout mode and per-app
  floating geometry.
- --no-restore, or :restore-session false in state.edn, starts with an empty desktop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjkHnYqipToGkWFC9P
2026-11-25 18:31:31 +00:00
VandClaude Opus 5.5 af774d76fe Rename the project to Chandra
CI / test (push) Failing after 16s
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.

Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.

The remote repository keeps its experiments/moon-plasma name for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
2026-11-25 17:12:57 +00:00
Claude 5dfe34027b Wallpaper chooser panel module, and four new wallpapers
CI / test (push) Failing after 17s
- New 'wallpaper' capability (wit/capabilities.wit: wallpapers, current-wallpaper, set-wallpaper)
  and 'wallpaper' panel module: a button whose popup lists the wallpapers with the current one
  ticked. Clicking a row switches the desktop at once (the list stays open to compare); Enter
  picks the highlighted row, Escape or a click elsewhere closes. In the default panel, before
  Log out.
- lib/shell: render_wallpaper(screen, tokens, index) with Plasma glow (the old background),
  Aurora, Starfield, Dusk and Solid, all draw ops; the themed ones follow a theme swap.
- The shell draws the chosen one (the renderer's wallpaper cache redraws it on change) and
  saves it in state.edn as :wallpaper (:aurora, ...); unknown names fall back to the default.
- Served by both hosts: wasmer stub (native) and host-wasm (publish-wallpaper, wallpapers
  table 5, set-wallpaper request).
- Tests: lib/shell wallpaper test, host-wasm module test, native end-to-end test (open, pick,
  Escape) and a state.edn round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhM8CTYpe2XVYTFQGn
2026-11-25 17:08:39 +00:00
Claude 7248e0ca6e Nested window: follow the host's size instead of being cropped
The --window backend pinned its xdg_toplevel to a fixed size (min == max ==
1280x720 or --size) and ignored xdg_toplevel.configure. Whenever the host gave
the window less room than that (a tiling host, a maximized/snapped window, a
screen smaller than the default once its own panels and title bar are taken
off), the host cropped the 1280x720 buffer and the right/bottom of the desktop,
panel included, was cut off. Fullscreen only looked right when the screen
happened to be at least that big.

- nested: drop the max size (min 640x400), read the configure size and, on
  xdg_wm_base v4, configure_bounds to fit the first size on screen; report a
  new size through take_resize.
- compositor: MoonPlasmaCompositor::resize recomputes the work area, tells
  clients the new wl_output mode, reflows every workspace and pulls floating
  windows back inside (WmState::fit_work_area), and forces a full redraw.
- both main loops (wasm component and native) resize before presenting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkYa7dkDnotDeMSdX7
2026-11-25 17:07:33 +00:00
Claude 0f4c84b966 Super+D shows the desktop: minimize every window, again to bring them back
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hktZQ73WicBDmBgP57
2026-11-25 17:07:33 +00:00
Claude 11d7e4d276 Login session: keep the real session bus so the PAM-unlocked GNOME keyring works
As a login session, launched apps were put on a private dbus-daemon bus (meant
only to stop single-instance apps forwarding to a host session when nested).
That bus has no org.freedesktop.secrets, so apps D-Bus-activated a second,
locked gnome-keyring-daemon on it: unlock prompts / "create default keyring"
dialogs, even though pam_gnome_keyring had already unlocked the login keyring.
The session script also wrapped everything in dbus-run-session whenever
DBUS_SESSION_BUS_ADDRESS was unset, splitting off from systemd's user bus.

- host-wasm + native sys stub: start the private bus only when nested
  (WAYLAND_DISPLAY or DISPLAY set); under --drm apps use the session bus.
- moon-plasma-session: use $XDG_RUNTIME_DIR/bus when it exists, fall back to
  re-running itself under dbus-run-session; push WAYLAND_DISPLAY and
  XDG_* into the D-Bus/systemd activation environment so gcr-prompter can show
  unlock prompts; run gnome-keyring-daemon --start --components=secrets.
- justfile run-drm(-native): update the activation environment too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhWvZgm7r2v8NpS2g4
2026-11-25 17:07:33 +00:00
Claude d0d375c071 Mouse wheel scrolls windows: forward scroll to Wayland clients
The wheel used to reach only the Interface Explorer dialog; clients never got
wl_pointer.axis, and the login-session (KMS/libinput) backend dropped scroll events.

- libinput axis events (wheel, touchpad, trackpoint) are queued as EV_AXIS and
  surface as InputEvent::Scroll(axis, value, discrete) in both the native and
  wasm (moonplasma:host/display seat-event.scroll) backends.
- The nested backend keeps horizontal scroll and the host's axis_discrete notches.
- The compositor sends axis_source(wheel) + axis_discrete/axis_value120 + axis +
  frame to the popup or window under the pointer; the explorer still takes the
  wheel while inspect mode is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjdz1uQ1y3GgazdKrR
2026-11-25 17:07:33 +00: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 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 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
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
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 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 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 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
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