Until now a module reload was only reachable by clicking Settings > Panel inside the session.
Now:
- The compositor listens on $XDG_RUNTIME_DIR/chandra/<wayland socket name>.sock (the login
session's is wayland-moon-0.sock) with a line protocol: ping, list, reload [NAME], help.
Replies end with an "ok ..." or "error ..." line. It lives in compositor/host/control.mbt,
runs from ChandraCompositor::step, and its fds join the idle loop's wait set, so an idle
desktop still sleeps (measured ~0.4% CPU on wasmhost, ~0.1% on host-wasm) and wakes for a
command. A path another live compositor answers on is left alone.
- DesktopShell::reload_modules(name) reloads every loaded module (or those whose module id,
stem, slot or path is NAME) in place via replace_slot: same panel position, saved
:module-config applied, a module that fails to load stays as it was and the error is
reported to the caller and shown as a notice. The catalog is rescanned.
- SIGUSR1 to the host reloads every module (result in the log and the notice): new WIT
function sys.take-sigusr1, implemented in compositor/sys (native build and wasmhost) and
host-wasm; the handler has no SA_RESTART so it interrupts the idle poll.
- session/chandra-ctl (installed to /usr/local/bin), `just reload [NAME]`, docs/reloading.md,
README.
- Tests: compositor/host/control_test.mbt (protocol, reload all / by name / by slot, order
and settings kept, failing module kept, busy socket). Checked headless on both hosts with
chandra-ctl and kill -USR1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjLJtvYcgW48okL6qQ
GPUI apps (Delta, Zed) answer a configure that takes the maximized state away by going back to
their old floating size, whatever size it asks for. Unmaximized into a tiled slot (or a layout
change while maximized), Delta kept drawing 640x480 and Chandra padded it out with the bottom
right colour to the whole frame, so only the sidebar and toolbar showed.
The server now tracks each toplevel's last configure and the serial the client acked. When a
client commits a buffer of another size after acking the latest configure, the same configure
is sent once more (GPUI, no longer maximized then, takes it). A client that still keeps its own
size gets a ToplevelSizeChosen: a floating window's frame follows it, a tiled, maximized or
fullscreen window keeps the compositor's size. Sizes take set_window_geometry and
set_buffer_scale into account.
CHANDRA_DEBUG_CONFIGURE=1 logs configures, acks and committed buffer sizes to stderr.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiKUmCPZNFNiGwd8EW
Left-clicking the Digital Clock (or the Binary Clock) opens a calendar flyout that
slides up out of the panel; Escape, a click elsewhere or another click on the clock
slides it back in.
- lib/clock/calendar.mbt: month maths (leap years, weekday, ISO week numbers), a
six-week grid, the flyout's state, drawing and hit testing. Header with the time
(in the clock's own 12/24-hour format) and the long date; month and year with
previous / Today / next buttons; weekday names; today circled in the accent colour,
other months' days muted. Keys: Escape closes, t today, p/n previous/next month.
- Module settings (right click): "Week starts on" Sunday/Monday and "Show week
numbers", for both clocks (saved per module like the other settings).
- compositor/shell/slide.mbt: popups of the clock modules slide (200 ms, ease-out in,
ease-in out), clipped to their final place so they come out of the panel edge; the
popup takes input at its final place at once. A popup below the panel would slide
the other way. Theme comes from the module's tokens, so dark/light follow.
- CPU: has_timed_work() is true only while a slide runs, so the main loop only keeps
the frame pace for those 200 ms; an open calendar redraws only when its minute or
month changes.
- Tests: lib/clock calendar tests (wasm), compositor/host/calendar_test.mbt (open,
slide finishes, month buttons, Escape / click outside / toggle, settings, binary
clock). Host failures are the 5 known input_test ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjahaLE5XqnCWoEwKv
- One shortcut table (compositor/shell/shortcuts.mbt): named actions with their default combos,
the same as before: Super tap launcher, Super+D, Alt+Tab, Super+Shift+S, Super+Shift+Print,
Print, Super+Print, Super+Ctrl+Print, Super+Shift+R, Super+Alt+R, Super+Ctrl+R. Combos are
"Super+Ctrl+Alt+Shift+Key" text (parse/print, aliases like Meta, PrtSc, Return); "Super" alone
is a Super tap. Two shortcuts on one combo conflict and the one listed first wins.
- The compositor looks every non-modifier key press up in the table (compositor/host/
shortcuts.mbt) instead of the hardcoded checks in showdesktop/screenshot/recorder; the switcher
reads its combo from it (hold the combo's modifiers, its key steps, Shift reverses, releasing a
held modifier switches). Matching is now exact on Super/Ctrl/Alt/Shift (caps/num lock ignored),
so e.g. Super+Shift+D or Ctrl+Print no longer fire Super+D / Print.
- Settings gets a fifth tab, Shortcuts (key 5, SettingsTab::Shortcuts): every shortcut and its
combo. Click a row (or Enter) and press the new keys: the compositor captures the combo before
anything else sees it (Escape cancels, Backspace unbinds, a Super tap binds "Super"; window
switching keeps waiting until the combo has a modifier). Changed rows get a Reset button
(Backspace/Delete on the highlighted row too), plus "Reset all to defaults"; conflicting combos
show in red with a line saying which shortcut wins. The popup is 360 px wide for the fifth tab.
- New `shortcuts` capability (shortcuts, capture, cancel-capture, reset, reset-all), served from
host table 10 and request 18 by the wasmer/wasmtime stub, host-wasm and the MoonBit wasmhost
(chandra:host/plasmoids `shortcut(s32)`).
- Changes are kept in state.edn as :shortcuts {:show-desktop "Super+Ctrl+D" ...} (only the ones
that differ; "" unbinds), applied at startup and live.
- There were no window-management or tiling key shortcuts to move into the table.
- Tests: combo parsing/printing, defaults, conflicts, switcher constraint, save/restore pairs,
rebinding through the compositor, capture (Escape/Backspace/Super tap), the Shortcuts tab
(capture, conflict line, Reset, Reset all) and the state.edn round trip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjypNwGHE9WeFvnWLA
Chrome (and Firefox, Electron, GTK 4, Qt 6) read dark/light from xdg-desktop-portal's Settings
interface. With XDG_CURRENT_DESKTOP=chandra and no chandra-portals.conf, xdg-desktop-portal found
no Settings backend (gtk/gnome are UseIn=gnome, kde is UseIn=KDE) and exported no Settings
interface at all, so the gsettings color-scheme a790901 sets never reached Chrome.
- compositor/portal: the compositor is an org.freedesktop.impl.portal.Settings backend
(org.freedesktop.impl.portal.desktop.chandra on the session bus): Read/ReadAll of
org.freedesktop.appearance color-scheme (1 dark, 2 light), SettingChanged when the switch flips,
version property, introspection. Login session only; the main loop wakes on its socket.
- compositor/network/dbus.mbt: serve calls (on_call, reply, reply_error), emit and receive
signals, sender field, session bus address.
- session/chandra.portal + chandra-portals.conf, installed to /usr/share/xdg-desktop-portal by
install.py: Settings from chandra first, then gtk/kde/gnome; other portals from gtk/kde/gnome.
- chandra-session restarts a running xdg-desktop-portal so it reads the config for this desktop.
- scripts/test-portal-dbus.sh: end to end behind the real xdg-desktop-portal on a private bus
(ReadOne gives 1, flipping gives SettingChanged 2). docs/dark-mode.md: how to check it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhkztRQM7vcSuHX4bB
- Right-clicking a pill in the task manager opens that window's menu (titled with the window's
title): Minimize (Restore when minimized), Maximize (Restore size when maximized) and Quit,
which asks the app to close the window (xdg_toplevel close, like the title-bar close button).
Empty task-bar space keeps the module's own menu (Module settings, Replace with, Remove widget).
- Modules only get left clicks, so the shell draws the menu and hit-tests the pills itself: the
pill geometry moved to lib/panel/tasks.mbt, shared by the tasks module and the shell. No WIT
change, so every host works as before.
- New menu row kind 6 and ShellAction::Window(id, WindowCommand); the compositor runs it through
the same WM requests as the title-bar buttons. WinInfo carries `maximized`.
- Tests: native end-to-end (menu rows, minimize/restore, maximize/restore size, Quit sends close,
empty space keeps the module menu) and lib/panel pill geometry tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiX13fXK1eMboRe5oQ
New chandra:host/raster functions, on both hosts: write-frame-png (--gfx-out),
grab-recording-frame / send-recording-frame (the recorder streams frames from the
host to ffmpeg) and snapshot-frame / snapshot-png / snapshot-pixels (screenshots
freeze, crop and encode the screen there; the magnifier and the notification's
thumbnail read small scaled copies). The wasm compositor sets them up through
frame_recorder and frame_shots; the native compositor keeps its pixel path.
Moving whole frames as list<u8> is cheap for the Rust host but costs about
0.4 s a 720p frame through the wasmtime C API. A full-screen screenshot now takes
45 ms on the MoonBit host (was 472) and 8 ms on the Rust host (was 112);
recording runs at 30 fps on both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
- Settings gets a Power tab (fourth; key 4 or SettingsTab::Power): the battery when there is
one (the system capability), "Turn screen off after" (Never, 1 min ... 1 hour; default 10 min)
and "Suspend after" (Never, 5 min ... 2 hours; default never), a click stepping through the
choices, and Suspend / Restart / Power off now. Restart and Power off need a second click.
- New `power` capability (screen-off-minutes, suspend-minutes and setters, suspend, power-off,
reboot), served by the wasmer stub (host ints 5/6, requests 13-15) and host-wasm
(publish-power, set-screen-off / set-suspend-after / power-action).
- The timeouts are kept in state.edn as :power {:screen-off N :suspend N} when not the defaults.
- Login session only (compositor/host/power.mbt): input restarts the idle time; power_tick,
run every pass of the main loop (an idle loop still wakes about once a second), turns the
screen off through DPMS and back on at the next input, and suspends once per idle spell.
Monotonic time stops in suspend, so a resumed machine waits for input and a new idle spell.
Suspend, restart and power off run `systemctl <verb> || loginctl <verb>` (logind, so its
inhibitors and polkit rules apply); a nested window only shows a notice.
- Display: chandra:host/display set-power and Kms::set_power; the shared C shim sets the
connector's legacy DPMS property, shows no frames while off (frame_ready false, so the idle
loop still sleeps), redoes the modeset when turned on, and keeps the screen off across a VT
switch.
- components/screenshot bindings regenerated (they were stale: the module didn't build).
- Tests: idle timer sequence, the Power tab driving the shell (timeouts, two-click power off),
the state.edn round trip, a host-wasm test of the tab, and logind commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
Measured headless and nested at 1080p (host-wasm), against main:
- Idle: ~9.4% CPU per compositor -> ~0.35%. Idle frames cost ~1.3 ms, and the loop
woke 60-125 times a second to find nothing had changed.
- One 800x600 floating client animating at 60 fps: 33% -> 16% CPU; raster per frame
~4.5 ms -> ~0.9 ms. A full-screen tiled client: 65% -> 54% (its cost is now mostly
copying the 8 MB buffer out of the client's shared memory).
Changes:
- shell: the wallpaper and desktop card ops (~1900, the moon disc is drawn per pixel)
are kept and reused until what they are drawn from changes (size, theme, wallpaper,
card position, date, hour:minute). This was ~75% of an idle frame.
- FrameSig compares the background by identity first instead of op by op.
- Host tables (windows, layouts, ...) are only sent to the host when their bytes change.
- Main loop: a pass with no input, no changed frame and nothing waiting to be shown
blocks in the new sys.wait-readable on the Wayland socket and clients (plus the
nested host connection; the login session's seat, DRM and libinput fds are added by
the host) until just before the wall clock's next second, then polls every 5 ms
until it turns, so clocks still tick on time. Recording, pending screenshots and
toasts keep the frame pace (ChandraCompositor::has_timed_work).
- Host raster: works out what changed from the last frame. When only windows changed
(a client drew, a window moved, focus moved) it redraws just their footprint
(decoration and shadow included, old and new place), copying back only that part
of the cached backdrop; anything else still redraws everything. A test checks the
partial redraw is pixel-identical to a full one for a client redraw, a move and a
focus change with stacking swapped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hku78wdzXtY9QsR9NW
The switcher is now a grid of cards: a scaled-down picture of each window's
last frame over its app icon and title, the selected card lit. Cards wrap
into rows and shrink to fit small screens.
- Previews keep the buffer's aspect ratio and are never enlarged.
- Minimized windows show the last frame they drew, dimmed, marked
"minimized". A window with no buffer yet shows its app icon (or its
initial) on a plain tile.
- Cheap: nothing is scaled while the switcher is closed. A preview is made
when the switcher opens and again only when that window commits a new
buffer (or its shown size changes), into the same image handle; handles
of closed windows are reused. The native scaler samples at most 3x3
points per preview pixel, so big windows cost about the same as small.
- Both hosts: native scales the wl_shm snapshot in the software renderer
(renderer.shm_thumbnail + set_image); the wasm compositor asks the host
with the new chandra:host/raster thumbnail(surface, w, h, reuse), which
scales the captured surface natively, so no pixels cross the boundary.
- Frames the screenshot overlay held back mark previews stale too.
Tests: switcher_test (preview pixels, aspect, no-buffer, stale and
remade into the same handle, minimized), renderer shm_thumbnail/set_image,
host-wasm thumbnail scaling and handle reuse. Pre-existing failures on
main are unchanged (6 panel-module host tests, the screenshot panel
module test, host-wasm translucent_surfaces_blend).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjDvAsSQUdTTUGA3n5
- Super+Shift+S (or Super+Shift+Print) freezes the screen under a selection overlay, like
Spectacle's Rectangular Region: drag a rectangle (size readout under it, magnifier while
drawing), drag inside to move it, drag its handles to resize, or click a window to select it.
Enter or a double-click takes it, Escape or right-click cancels; F full screen, W active window,
arrows nudge (Shift+arrows resize). Print takes the full screen, Super+Print the active window,
Super+Ctrl+Print the window under the pointer.
- Saved as ~/Pictures/Screenshots/Screenshot_YYYYMMDD_HHMMSS.png (XDG_PICTURES_DIR honoured),
put on the clipboard as image/png (compositor-owned wl_data selection, written to the paste
pipe without blocking), and confirmed by a notification with a thumbnail.
- Screen recording: Super+Shift+R picks a region on the same overlay, Super+Alt+R the screen,
Super+Ctrl+R a window; the same shortcut or the REC pill (top centre) stops. Raw frames
(<= 30 fps, wall-clock stamped) stream into ffmpeg over a unix socket; it writes H.264 MP4 to
~/Videos/Screencasts/Screencast_*.mp4. The pointer is drawn in unless switched off.
- renderer: encode_png_compressed (per-row filters + LZ77/fixed-Huffman deflate): a 1280x720
desktop is ~90 KB instead of 3.7 MB.
- New 'screenshot' capability and 'screenshot' panel module (in the default panel): Spectacle's
modes and the recording modes with their shortcuts, and a pointer switch; the button becomes
Stop while recording. Served by both hosts (wasmer stub request 12 / host int 4; host-wasm
publish-screenshot and a screenshot request). Panel requests wait for a frame without the
module's popup.
- sys: pwrite with a negative offset is a non-blocking write (pipes, sockets), SIGPIPE ignored.
- Tests: native overlay, shortcuts, window pick, module, recording (with ffmpeg); host-wasm
module test; renderer compression test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjMGSLc5tHuzjsxGVa
Chrome's context menu opened and closed at once: when a client created an
xdg_popup the compositor moved keyboard focus to it straight away, and the
wl_keyboard.leave on the window made Chrome dismiss the menu. Popups now
only take the keyboard when they ask for a grab (xdg_popup.grab, as Qt
menus do) and once they have a buffer; Chrome's grab-less menus leave
focus on the window.
Also:
- honour xdg_positioner constraint adjustment (flip, slide, resize) so the
configure tells the client where its menu really is, instead of the host
silently nudging it on screen (Chrome then took the button release as a
click on a menu item);
- answer xdg_popup.reposition with repositioned + configure (it was ignored,
so clients waiting for it stalled);
- place popups by their window geometry, so Chrome's client-drawn menu
shadow no longer shifts the menu right and down.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hikqzveCoytgF4Uyvh
Two left presses on the same title bar within 400ms and 4px of each other
toggle maximize, like the title-bar button. A press that turned into a drag
never starts a double-click. A tiled window now floats only once the pointer
actually moves, so clicking or double-clicking its title bar leaves it in
(and restores it to) its tile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjF2tD2UuaXLzFzrvV
In the login session (--drm) the settings module's Dark mode switch, and the saved choice at
startup, now also set what other programs follow (compositor/host/system_theme.mbt):
- gsettings org.gnome.desktop.interface color-scheme prefer-dark|default: the portal's
org.freedesktop.appearance color-scheme, followed by Chrome/Chromium, Electron, Firefox,
GTK 4 / libadwaita and Qt 6.5+;
- gtk-theme Adwaita <-> Adwaita-dark for GTK 3 (only when it is one of those two);
- gtk-application-prefer-dark-theme in gtk-3.0 and gtk-4.0 settings.ini;
- KDE color scheme BreezeDark|BreezeLight via plasma-apply-colorscheme, else kwriteconfig6/5
(kdeglobals [General] ColorScheme);
- qt6ct/qt5ct: a *-light / *-dark color file is swapped for its counterpart when it exists.
Missing tools are skipped. Nested windows and tests leave the system alone
(ChandraCompositor::sync_system_theme, set from --drm).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
- 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
- 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
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
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>
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>
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>
- 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>