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
This commit is contained in:
VandClaude Opus 5.5 committed 2026-11-25 17:12:57 +00:00
1 parent 5dfe34027b
commit af774d76fe
323 files changed
+1055 -1013

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
//! The login-session display backend: calls into compositor/kms/kms_stub.c (built by build.rs),
//! the same shim the native compositor uses. One display, one seat, global state.
use crate::moonplasma::host::display::{KeyState, Modifiers, Output, PointerPos, ScrollDelta, SeatEvent};
use crate::chandra::host::display::{KeyState, Modifiers, Output, PointerPos, ScrollDelta, SeatEvent};
extern "C" {
fn mp_kms_open() -> i32;
+37 -37
View File
@@ -1,12 +1,12 @@
//! Native host for the moon-plasma compositor component.
//! Native host for the chandra compositor component.
//!
//! The compositor is a wasm component (build/compositor.wasm) that imports exactly one
//! interface, `moonplasma:host/sys` (wit/host/sys.wit): sockets, memfd, poll, spawn, files, time.
//! interface, `chandra:host/sys` (wit/host/sys.wit): sockets, memfd, poll, spawn, files, time.
//! This program is the other side of that interface. The component only ever holds integer
//! handles; every real file descriptor lives here.
//!
//! moon-plasma-host [--component PATH] [-- compositor args...]
//! moon-plasma-host build/compositor.wasm --socket /run/user/1000/wayland-moon-0 --window
//! chandra-host [--component PATH] [-- compositor args...]
//! chandra-host build/compositor.wasm --socket /run/user/1000/wayland-moon-0 --window
use std::ffi::CString;
use std::io::Read;
@@ -28,13 +28,13 @@ wasmtime::component::bindgen!({
// Draw operations are compared to reuse the cached wallpaper.
additional_derives: [PartialEq],
with: {
"moonplasma:desktop/types@0.1.0": plasmoid::ph::moonplasma::desktop::types,
"moonplasma:desktop/theme@0.1.0": plasmoid::ph::moonplasma::desktop::theme,
"chandra:desktop/types@0.1.0": plasmoid::ph::chandra::desktop::types,
"chandra:desktop/theme@0.1.0": plasmoid::ph::chandra::desktop::theme,
},
});
use moonplasma::host::font::Glyph;
use moonplasma::host::sys::{Host, Received};
use chandra::host::font::Glyph;
use chandra::host::sys::{Host, Received};
#[derive(Default)]
struct State {
@@ -44,7 +44,7 @@ struct State {
started: Option<std::time::Instant>,
/// TTF faces loaded by the component (`font.load`), by slot, and their glyph cache.
fonts: raster::Fonts,
/// The framebuffer and client surfaces behind `moonplasma:host/raster`.
/// The framebuffer and client surfaces behind `chandra:host/raster`.
raster: raster::Raster,
/// Runs the panel modules; set once the engine exists.
pl: Option<plasmoid::Runtime>,
@@ -123,10 +123,10 @@ impl State {
}
}
impl moonplasma::host::plasmoids::Host for State {
fn load(&mut self, path: String) -> Result<moonplasma::host::plasmoids::Loaded, String> {
impl chandra::host::plasmoids::Host for State {
fn load(&mut self, path: String) -> Result<chandra::host::plasmoids::Loaded, String> {
let l = self.pl().load(&path)?;
Ok(moonplasma::host::plasmoids::Loaded {
Ok(chandra::host::plasmoids::Loaded {
handle: l.handle,
id: l.info.id,
name: l.info.name,
@@ -141,27 +141,27 @@ impl moonplasma::host::plasmoids::Host for State {
self.pl().unload(handle);
}
fn set_tokens(&mut self, t: plasmoid::ph::moonplasma::desktop::theme::Tokens) {
fn set_tokens(&mut self, t: plasmoid::ph::chandra::desktop::theme::Tokens) {
self.pl().shared.borrow_mut().tokens = Some(t);
}
fn render(
&mut self,
handle: u32,
box_: plasmoid::ph::moonplasma::desktop::types::Size,
) -> Vec<plasmoid::ph::moonplasma::desktop::types::DrawOp> {
box_: plasmoid::ph::chandra::desktop::types::Size,
) -> Vec<plasmoid::ph::chandra::desktop::types::DrawOp> {
self.pl().render(handle, box_)
}
fn popup(&mut self, handle: u32) -> Option<moonplasma::host::plasmoids::PopupSurface> {
self.pl().popup(handle).map(|p| moonplasma::host::plasmoids::PopupSurface { box_: p.size, ops: p.ops })
fn popup(&mut self, handle: u32) -> Option<chandra::host::plasmoids::PopupSurface> {
self.pl().popup(handle).map(|p| chandra::host::plasmoids::PopupSurface { box_: p.size, ops: p.ops })
}
fn on_event(
&mut self,
handle: u32,
on_popup: bool,
event: plasmoid::ph::moonplasma::desktop::types::InputEvent,
event: plasmoid::ph::chandra::desktop::types::InputEvent,
) -> bool {
self.pl().on_event(handle, on_popup, event)
}
@@ -183,8 +183,8 @@ impl moonplasma::host::plasmoids::Host for State {
self.pl().shared.borrow_mut().wallpaper = current;
}
fn publish_system(&mut self, s: moonplasma::host::plasmoids::SystemSnapshot) {
use plasmoid::ph::moonplasma::desktop::system::Snapshot;
fn publish_system(&mut self, s: chandra::host::plasmoids::SystemSnapshot) {
use plasmoid::ph::chandra::desktop::system::Snapshot;
self.pl().shared.borrow_mut().system = Some(Snapshot {
cpu_permille: s.cpu_permille,
mem_used_kib: s.mem_used_kib,
@@ -198,13 +198,13 @@ impl moonplasma::host::plasmoids::Host for State {
});
}
fn publish_windows(&mut self, wins: Vec<moonplasma::host::plasmoids::WindowEntry>) {
fn publish_windows(&mut self, wins: Vec<chandra::host::plasmoids::WindowEntry>) {
self.pl().shared.borrow_mut().windows =
wins.into_iter().map(|w| (w.id, w.title, w.app_id, w.focused)).collect();
}
fn next_request(&mut self) -> Option<moonplasma::host::plasmoids::Request> {
use moonplasma::host::plasmoids::Request as R;
fn next_request(&mut self) -> Option<chandra::host::plasmoids::Request> {
use chandra::host::plasmoids::Request as R;
use plasmoid::Req;
let r = self.pl().shared.borrow_mut().requests.pop_front()?;
Some(match r {
@@ -239,8 +239,8 @@ impl moonplasma::host::plasmoids::Host for State {
self.pl().picker_start()
}
fn picker_poll(&mut self) -> moonplasma::host::plasmoids::PickerState {
use moonplasma::host::plasmoids::PickerState as P;
fn picker_poll(&mut self) -> chandra::host::plasmoids::PickerState {
use chandra::host::plasmoids::PickerState as P;
match self.pl().picker_poll() {
None => P::Open,
Some(None) => P::Cancelled,
@@ -249,8 +249,8 @@ impl moonplasma::host::plasmoids::Host for State {
}
}
impl moonplasma::host::display::Host for State {
fn open(&mut self) -> Option<moonplasma::host::display::Output> {
impl chandra::host::display::Host for State {
fn open(&mut self) -> Option<chandra::host::display::Output> {
#[cfg(feature = "drm")]
{
kms::open()
@@ -289,7 +289,7 @@ impl moonplasma::host::display::Host for State {
#[cfg(not(feature = "drm"))]
let _ = shape;
}
fn take_input(&mut self) -> Vec<moonplasma::host::display::SeatEvent> {
fn take_input(&mut self) -> Vec<chandra::host::display::SeatEvent> {
#[cfg(feature = "drm")]
return kms::take_input();
#[cfg(not(feature = "drm"))]
@@ -301,7 +301,7 @@ impl moonplasma::host::display::Host for State {
}
}
impl moonplasma::host::font::Host for State {
impl chandra::host::font::Host for State {
fn load(&mut self, slot: u32, path: String) -> bool {
self.fonts.load(slot, &path)
}
@@ -312,7 +312,7 @@ impl moonplasma::host::font::Host for State {
}
}
impl moonplasma::host::raster::Host for State {
impl chandra::host::raster::Host for State {
fn capture(&mut self, fd: i32, offset: i32, stride: i32, width: i32, height: i32, format: i32) -> u32 {
if fd < 0 || offset < 0 || stride <= 0 || width <= 0 || height <= 0 {
return 0;
@@ -343,7 +343,7 @@ impl moonplasma::host::raster::Host for State {
self.raster.release(id);
}
fn submit(&mut self, f: moonplasma::host::raster::Frame) {
fn submit(&mut self, f: chandra::host::raster::Frame) {
self.raster.submit(&f, &mut self.fonts);
}
@@ -353,7 +353,7 @@ impl moonplasma::host::raster::Host for State {
fn export_memfd(&mut self) -> i32 {
let data = self.raster.to_argb8888();
let Ok(name) = CString::new("moon-plasma-frame") else { return -1 };
let Ok(name) = CString::new("chandra-frame") else { return -1 };
unsafe {
let fd = libc::memfd_create(name.as_ptr(), libc::MFD_CLOEXEC);
if fd < 0 {
@@ -730,11 +730,11 @@ fn main() -> Result<()> {
}
};
let mut linker: Linker<State> = Linker::new(&engine);
moonplasma::host::sys::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
moonplasma::host::font::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
moonplasma::host::raster::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
moonplasma::host::display::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
moonplasma::host::plasmoids::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
chandra::host::sys::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
chandra::host::font::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
chandra::host::raster::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
chandra::host::display::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
chandra::host::plasmoids::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
let mut store = Store::new(&engine, State::default());
store.data_mut().pl = Some(plasmoid::Runtime::new(&engine)?);
let compositor = Compositor::instantiate(&mut store, &component, &linker)?;
+9 -9
View File
@@ -22,8 +22,8 @@ pub mod ph {
additional_derives: [PartialEq],
});
}
use ph::exports::moonplasma::desktop as ex;
use ph::moonplasma::desktop as d;
use ph::exports::chandra::desktop as ex;
use ph::chandra::desktop as d;
/// What a module asked of the compositor during a call.
pub enum Req {
@@ -347,11 +347,11 @@ impl Runtime {
return Err("not a wasm file".to_string());
}
let component = Component::new(&self.engine, &bytes)
.map_err(|_| "no plasmoid (moonplasma:desktop/plasmoid) in this module".to_string())?;
.map_err(|_| "no plasmoid (chandra:desktop/plasmoid) in this module".to_string())?;
// The capability grant: the host interfaces the binary imports, besides the base ones.
let mut imports: Vec<String> = Vec::new();
for (name, _) in component.component_type().imports(&self.engine) {
if let Some(rest) = name.strip_prefix("moonplasma:desktop/") {
if let Some(rest) = name.strip_prefix("chandra:desktop/") {
let iface = rest.split('@').next().unwrap_or(rest).to_string();
if iface != "types" && !imports.contains(&iface) {
imports.push(iface);
@@ -362,7 +362,7 @@ impl Runtime {
let inst = ph::PlasmoidHost::instantiate(&mut store, &component, &self.linker)
.map_err(|_| "wasm runtime error".to_string())?;
let info = inst
.moonplasma_desktop_plasmoid()
.chandra_desktop_plasmoid()
.call_info(&mut store)
.map_err(|_| "widget trapped in info()".to_string())?;
let l = Loaded { store, inst };
@@ -392,18 +392,18 @@ impl Runtime {
/// A trapping module yields no ops.
pub fn render(&mut self, handle: u32, size: d::types::Size) -> Vec<d::types::DrawOp> {
let Some(l) = self.get(handle) else { return Vec::new() };
l.inst.moonplasma_desktop_plasmoid().call_render(&mut l.store, size).unwrap_or_default()
l.inst.chandra_desktop_plasmoid().call_render(&mut l.store, size).unwrap_or_default()
}
pub fn popup(&mut self, handle: u32) -> Option<ex::plasmoid::PopupSurface> {
let l = self.get(handle)?;
l.inst.moonplasma_desktop_plasmoid().call_popup(&mut l.store).ok().flatten()
l.inst.chandra_desktop_plasmoid().call_popup(&mut l.store).ok().flatten()
}
pub fn on_event(&mut self, handle: u32, on_popup: bool, ev: d::types::InputEvent) -> bool {
let Some(l) = self.get(handle) else { return false };
let target = if on_popup { ex::plasmoid::Surface::Popup } else { ex::plasmoid::Surface::Widget };
l.inst.moonplasma_desktop_plasmoid().call_on_event(&mut l.store, target, &ev).unwrap_or(false)
l.inst.chandra_desktop_plasmoid().call_on_event(&mut l.store, target, &ev).unwrap_or(false)
}
pub fn picker_start(&mut self) -> bool {
@@ -522,7 +522,7 @@ mod tests {
fn modules_are_rejected_cleanly() {
let mut rt = runtime();
assert!(rt.load("/nonexistent.wasm").is_err());
let junk = std::env::temp_dir().join("moon-plasma-junk.wasm");
let junk = std::env::temp_dir().join("chandra-junk.wasm");
std::fs::write(&junk, b"not wasm at all").unwrap();
assert!(rt.load(junk.to_str().unwrap()).is_err());
}
+2 -2
View File
@@ -1,11 +1,11 @@
//! The host's rasteriser (`moonplasma:host/raster`).
//! The host's rasteriser (`chandra:host/raster`).
//!
//! A direct port of compositor/renderer (the pure-MoonBit software renderer), so a frame comes out
//! pixel for pixel the same, but native: the compositor component sends draw operations and window
//! surface ids, and the pixels never cross the component boundary. Window buffers are copied out of
//! the client's shared memory once, at commit (`capture`), converted to RGBA, and kept here.
use crate::moonplasma::host::raster as wt;
use crate::chandra::host::raster as wt;
use ab_glyph::{Font, FontVec, OutlineCurve};
use ab_glyph_rasterizer::{point, Rasterizer};
use std::collections::HashMap;