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
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
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>
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>
- 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>
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>
: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>
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>
: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>
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>
- 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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
- 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>
- 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>
- 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>
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>