Commit Graph
90 Commits
Author SHA1 Message Date
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
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
Antigravity 7caadb3f7f feat(gfx): integrate wasi-gfx for loading and presenting GUI
CI / test (push) Successful in 24s
2026-11-25 02:54:03 +00: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
Antigravity ae4f3fa93c Replace Rust host-native with 100% pure-MoonBit Wayland compositor
CI / test (push) Successful in 36s
2026-11-25 01:18:46 +00:00