Commit Graph
91 Commits
Author SHA1 Message Date
lotherk b330b3b60a dtchat: add the generic account editor (T2.4)
ui_accounts.c builds the account list and a settings form from the adapter schema: text, secret, int, bool, choice, info and button. Secrets are collected into a separate JSON object and never shown; a modifyVerify callback keeps the masked text while the field stores the real value (this Motif has no XmNechoChar). Add/Delete create or remove accounts through dc_model_remove_account, Save validates required fields and numbers and updates the account label. Wired to File/Accounts... with a demo IRC schema. Standalone build clean; dialog opens on Xvfb, password masked, Save shows 'saved (demo)'; test_conv and ASan/UBSan green. make mcde-host could not run: another agent's release build holds build/.build.lock (pid 175328).
2026-11-16 18:42:58 +00:00
lotherk 8911994262 dtchat: bind the roster to the model (T2.2)
DcPresence on DcConv (offline default, online/away/dnd); the roster lists accounts and conversations with presence marks and unread counts, 45 demo rooms make it scroll, selection sets the title/topic, fills the transcript from the 2000-message ring and clears unread. The demo model lives in main.c; --smoke-test selects jabber/bob@example.org and checks viewable, selection, transcript and unread==0. make mcde-host exit=0; built smoke PASS; test_conv all ok; screenshot build/mcde-shots/dtchat-t22.png; PSS 5.6 MB.
2026-11-16 18:27:40 +00:00
lotherk fa6b5cdfa4 dtchat: enforce the adapter hello timeout
A child that does not send hello within 10 s is killed; the normal restart backoff applies. Aligns adapter.c with the v1 protocol document.
2026-11-16 17:49:11 +00:00
lotherk 581735f013 dtchat: add the single-instance lock and control socket (T1.6)
instance.c: DIR/run 0700, dtchat.lock 0600 with flock(LOCK_EX|LOCK_NB), primary Unix listener at dtchat.sock 0600, one open request per client with a 2 s timeout, non-primary instance plus dc_instance_notify with connect retries, and socket/lock cleanup on close. test_instance covers primary/secondary, modes, open callback, malformed client, notify after close and re-acquisition. make mcde-host exit=0; all eight dtchat tests 'all ok'; ASan/UBSan clean. SIGPIPE is ignored so a dead local client cannot kill the core.
2026-11-16 17:45:58 +00:00
lotherk e162ba645d dtchat: add the adapter process manager (T1.5)
adapter.c spawns a helper, waits for hello (ipc 1), sends configure/connect, routes events, drains stderr, buffers stdin, reaps zombies and restarts with 2..60 s backoff unless the child said bye. fake_adapter.c and test_adapter.c cover normal handshake, send/message echo, join/answer, stop/bye, crash restart and invalid JSON. make mcde-host exit=0; test_adapter 'all ok'; ASan/UBSan clean. test_adapter_DEPENDENCIES now includes libDtChat/libDtChatIpc to avoid the parallel relink race.
2026-11-16 17:35:28 +00:00
lotherk 83741ce6eb dtchat: add the conversation model and text helpers (T1.4)
conv.c: accounts, conversations, topics, idempotent add, a 2000-message ring buffer and unread counts that ignore our own/system messages. text.c: UTF-8 validation, C0 cleaning, mIRC formatting strip and iconv display with ASCII//TRANSLIT and '?' fallbacks. test_conv and test_text cover duplicate adds, ordering, the ring boundary, flags/unread, IRC codes, CR/CRLF and ISO-8859-1/ASCII output. make mcde-host exit=0; all six dtchat tests report 'all ok'; ASan/UBSan clean.
2026-11-16 17:18:12 +00:00
lotherk 82ab2cb4b5 dtchat: add the atomic state store (T1.3)
store.c keeps accounts.json, secrets.json and identity.json in a 0700 directory with 0600 files, writes through a temporary file with fsync/rename/dir-fsync, repairs a wrong file mode on load, moves invalid JSON to NAME.bad and rejects path names. test_store covers accounts/secrets/identity, overwrite, corrupt/missing files, stale tmp, read-only directory, default HOME path and permissions. make mcde-host exit=0; test_json, test_frame, test_loop and test_store all ok; ASan/UBSan clean.
2026-11-16 17:09:27 +00:00
lotherk 4e97d5930d dtchat: add the poll and timer event loop (T1.2)
loop.c: one poll(2) per run, monotonic one-shot timers (sorted, FIFO on equal deadlines), non-blocking wakeup pipe and safe fd dispatch when a callback removes another fd. test_loop covers timer order/cancel, timeout, wakeup, pipe, delete-in-callback, timer-added-timer, monotonicity and invalid arguments. make mcde-host exit=0; test_json, test_frame and test_loop all ok.
2026-11-16 17:00:50 +00:00
lotherk 7dbaad5afa dtchat: build the IPC tests with mcde-host (T1.1)
test_json and test_frame are noinst_PROGRAMS so the native build produces them for tools/mcde-tests.sh; TESTS still runs them under make check.
2026-11-16 16:45:22 +00:00
lotherk ffb067372b dtchat: fail cleanly on a zero-byte frame write
dc_frame_send now returns -1 instead of looping when write(2) returns 0 for the payload or the trailing newline.
2026-11-16 16:38:50 +00:00
lotherk e645e8160d dtchat: add the core API, JSON reader and line framing (T1.1)
include/DtChat/DtChat.h and Ipc.h define the UI-facing core API and the adapter contract. lib/libDtChat builds libDtChatIpc (strict JSON parser/writer, 1 MiB line framing) and the libDtChat core stub; test_json and test_frame cover escapes, UTF-8, depth 32, duplicate keys, overlong lines, CRLF, NUL and the write path. Wired into configure.ac, lib/Makefile.am and the installed headers. Standalone tests pass, ASan/UBSan clean.
2026-11-16 16:35:48 +00:00
lotherk f4ec4a1da1 MCDE: the disk-removed warning through the kernel's device events (t0093)
A medium that is pulled while it is still mounted now gets the reference's
one-button "Disk Not Ejected" warning: Motif's error dialog, the device and
its stale mountpoint in the text, the Warning sound.  The desktop (dtwm,
WmMcdeDesktop.c) owns the event descriptor already; it reads each event,
asks what it says, and checks the mount table before it shows anything.

McdeSys:
- mcde_sys_disk_event_info() parses both shapes the read gives: Linux's
  uevent with its NULs turned into spaces ("remove@/... ACTION=remove
  DEVNAME=sdb1 ...") and NetBSD's "device-detach sd0"; 1 when the device
  went away, 0 for add/change/attach, -1 on bad arguments.
- mcde_sys_disk_detached(name, mountpoint, len): looks in the mount table
  for a partition of NAME (sdb takes sdb1, sd0 takes sd0a), copies the
  mountpoint and unmounts it the forced way -- "umount -l" on Linux,
  "umount -f" on NetBSD (disk_linux.c, disk_netbsd.c) -- but never what the
  computer runs from.  0 when nothing of NAME was mounted.
- test_disk_events.c: the uevent and drvctl shapes, add/change/attach,
  missing DEVNAME, the bad arguments.  make check: 8/8 PASS (the seven
  before and this one).

Measured under Xvfb :79 with a real ext4 loop mount at /tmp/opencode/mnt:
- start of dtwm with MCDE_DESK_TEST_DEVICE="remove@/... DEVNAME=loop0":
  log "desktop: loop0 (remove)", "umount: /tmp/opencode/mnt: must be
  superuser to unmount.", "desktop: loop0 was mounted at
  /tmp/opencode/mnt"; the dialog is 354x167 at (335,300), OK as the only
  button (docs/screenshots/leopard/Device-Removal-mcde.png).
- sudo umount /tmp/opencode/mnt, the same event again: log "desktop: loop0
  (remove)" and no "was mounted"; zero dialog windows -- a device that was
  put away stays quiet.
- make mcde-linux MCDE_DIRS="install lib/McdeSys programs/dtwm" exit=0;
  MCDE_DIRS=plist "mcde-plist-check: ok".

MCDE_DESK_TEST_DEVICE is the test hook: one event line through the same
handler a real event takes, without a kernel.  The NetBSD drvctl branch is
unchanged (t0272); the force unmount there is written for it but was not
run.  Still open in t0093: the Eject item in dtfile (Selected menu,
Command+E) and the qemu device_del test in a VM.
2026-11-16 13:56:06 +00:00
lotherk df81373057 MCDE: the WEB_URL data type and the hanging test_sysload child (t0303)
A .url file is a WEB_URL now (the reference sdturl.dt): a text file
whose content is a URL, ACTIONS McdeWeb,Print, ICON Dtdata,
NAME_TEMPLATE %s.url, MIME text/x-url.  Measured in dtfile: test.url
shows the URL icon beside note.txt (screenshot).

test_sysload: the child that waits for a signal sets alarm(60), so a
hung or killed test no longer leaves it in pause() and blocks the
build lock with waitpid.
2026-11-16 13:04:42 +00:00
lotherk ff3e93ee10 McdeSys: the NetBSD disk and mount errors in the catalog (t0282)
disk_netbsd.c (16 calls) and mount_netbsd.c (2) are catalogued now: messages
218-233 for the new sentences (no hw.disknames, a %s partition cannot be
mounted/checked, no %s here, the name rule with blanks and 32 characters, the
new partition did not appear, no /etc/mtree, repairing permissions needs the
administrator, no mount table) and the numbers that already existed for the
same texts as on Linux (no disk %s, not mounted, the system's, erasing needs
the administrator, no drive, holds the system, mounted on, no room for the
mounts).  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Verification: both files pass
x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's sysroot
(they are only compiled on NetBSD).  The catalog was measured through
mcde_sys_msg (the function the backend calls): LANG=C "No list of disks
(hw.disknames).", "A name has letters, digits, blanks, - and _, at most 32.",
"Only the administrator can repair permissions."; LANG=de_DE.UTF-8 "Keine
Plattenliste (hw.disknames).", "Ein Name hat Buchstaben, Ziffern, Leerzeichen,
- und _, höchstens 32.", "Nur der Administrator kann die Rechte reparieren."

make mcde-linux was refused by the build lock: another session holds it
(tools/build-lock.sh tools/userland.sh, pid 3102819) -- one build at a time,
root AGENTS.md.  The two changed sources are NetBSD-only, so the Linux
library is unaffected; the Linux build, check and plist run follows when the
lock is free.
2026-11-16 12:12:39 +00:00
lotherk 5f1d166ac8 McdeSys: net, logs and the Linux disk/mount errors in the catalog (t0282)
net.c (11 calls), logs.c (9), disk_linux.c (13) and mount_linux.c (1) are
messages 187-217 of mcdesys.cat now: no interfaces, no card of that name,
the network-settings administrator sentence, the address checks (IPv4,
subnet mask, router, IPv6 with prefix, DNS, domain), the DHCP client ID
rule; the log sentences (no room, no name, inotify missing, cannot be
watched/read, kqueue is a follow-up on this system, no buffer); the disk
sentence set (lsblk/udisksctl missing, no such disk, not mounted, the
system's, cannot be checked, erasing needs the administrator, the name rule,
no drive, holds the system, mounted on, no permissions list); "No
/proc/mounts."  German copy with the same numbers in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C "Only the
administrator can change the network settings: click the lock first." and
"This log cannot be read."; LANG=de_DE.UTF-8 "Nur der Administrator kann die
Netzwerkeinstellungen ändern: zuerst entsperren." and "Dieses Log kann nicht
gelesen werden."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 12:09:36 +00:00
lotherk 777bd7c8e6 McdeSys: netbsd.c in the catalog, German measured (t0282)
The NetBSD backend's 79 mcde_sys_fail calls are catalogued now: 43 new
messages (144-186) for its own sentences plus the numbers that already
existed for the same texts (cannot write, out of memory, no such service,
the administrator sentences, no account, no network card, the comments, the
lock as set/clear two messages, unknown power action).  The new ones: did
not start, count/list the processes, ntp.conf and /etc/myname, read/read with
strerror, beside a file, the touchpad administrator/no touchpad/setting could
not be written, DRVGETEVENT, PKG_PATH, salt, the update source (not set, does
not answer, not allowed), the Wi-Fi scan/renew administrator sentences,
secure virtual memory, mdnsd, processes change too fast, outputs.master, the
Wi-Fi name/password rule, hashing, the server not installed (with a name),
swap encryption unknown/sysctl, the system's CPU times/disk counters/
interfaces/memory/number of processors, no place for state/value, cgd, npf,
too many settings, dhcpcd renew/start.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

netbsd.c is not compiled on this Linux host: it passes
x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's sysroot.
The catalog itself was measured through mcde_sys_msg (the function the
backend calls), LANG=C vs LANG=de_DE.UTF-8:
154 "Changing the touchpad needs the administrator." / "Das Touchpad zu
ändern braucht den Administrator.",
165 "... (a password has 8 to 63 characters, no quotes)." / "... (ein
Passwort hat 8 bis 63 Zeichen, keine Anführungszeichen).",
176 "The update source is not allowed: ..." / "Die Update-Quelle ist nicht
erlaubt: ...".
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:57:25 +00:00
lotherk 8d129c56c4 McdeSys: the rest of linux.c in the catalog, German measured (t0282)
linux.c's remaining sentences are messages 107-143 of mcdesys.cat now (the
NetworkManager block was 98-106): unknown power action, no sound server and
no mixer / the mixer tells no volume / no mixer, bluetoothctl missing, the
touchpad settings are outside the desktop, the password/change/update/service
administrator sentences, apt-get cannot tell what is new, cannot read /proc,
the file system keeps no comments / no lock, read/remove/write the comment,
cannot open a file, set/clear the lock (two messages, the word is not a
parameter any more), cannot write /etc/hostname, no hostname tool,
timedatectl is not installed, no such service, the server is not installed,
avahi-browse missing, secure virtual memory / cgd / npf are NetBSD's,
/proc/stat, /proc/meminfo, /proc/net/dev, /proc/diskstats and the kernel
event socket cannot be read, the two "tells no processor/memory" sentences.
German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C "Cannot
write /etc/hostname: Permission denied." and "Only the administrator can
switch a service."; LANG=de_DE.UTF-8 "/etc/hostname kann nicht geschrieben
werden: Keine Berechtigung." and "Nur der Administrator kann einen Dienst
umschalten."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:48:04 +00:00
lotherk 086189b68f McdeSys: linux.c's network errors in the catalog, German measured (t0282)
The NetworkManager block of linux.c is messages 98-106 of mcdesys.cat now:
nmcli not there / not installed (the settings cannot be changed here), only
the administrator can join a Wi-Fi network, the network name cannot be used,
NetworkManager has no settings for a card, nmcli does not tell the settings
of a connection, NetworkManager did not take the settings or could not bring
a connection up again, there is no network card of that name.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls):
LANG=C: "Only the administrator can join a Wi-Fi network." and
"NetworkManager has no settings for nosuchcard0."; LANG=de_DE.UTF-8: "Nur der
Administrator kann einem WLAN beitreten." and "NetworkManager hat keine
Einstellungen für nosuchcard0."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:38:54 +00:00
lotherk e0ab05b677 McdeSys: common.c's remaining errors in the catalog, German measured (t0282)
The rest of common.c's sentences are messages 74-97 of mcdesys.cat now: the
exec failure line, no host name, no time zone list, no such time zone, the
administrator for the time zone, cannot link, cannot replace (the same text
as message 59, reused), no command line for a process, no room for the CPU
times / memory / network counters / disk counters / process list, that is no
process to signal, the process belongs to somebody else, it is gone, cannot
signal it, no file (and no room) for the comment, no file for the lock, no
name a computer can take, no place for the time service state, cannot set the
clock.  German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C
"\"bad name!\" is not a name a computer can take.", "There is no time zone
\"No/Such\".", "No place for the list of processes."; LANG=de_DE.UTF-8
"\"bad name!\" ist kein Name, den ein Rechner annehmen kann.", "Es gibt keine
Zeitzone \"No/Such\".", "Kein Platz für die Prozessliste."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:26:21 +00:00
lotherk 893313c873 McdeSys: the device event and mount errors in the catalog (t0282)
events.c's five and mount.c's one mcde_sys_fail calls are messages 68-73 of
mcdesys.cat now: the kernel's event socket cannot be opened or bound, cannot
open /dev/drvctl (is the drvctl pseudo-device configured?), device events
have no source on this system, no room for the event, no room for the
mounts.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Measured with a runner (setlocale + mcde_sys_disk_event_read(-1, ...) and
mcde_sys_mounts(m, 0)): LANG=C "No room for the event." / "No room for the
mounts."; LANG=de_DE.UTF-8 "Kein Platz für das Ereignis." / "Kein Platz für
die Einhängepunkte."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:20:15 +00:00
lotherk a584ad9c45 McdeSys: the sharing and account errors in the catalog (t0282)
share.c's seven and users.c's six mcde_sys_fail calls are messages 57-67 of
mcdesys.cat now: cannot write beside/into a file, cannot replace, only the
administrator can change what is shared, no folder that can be shared; no
name for an account, an account exists already, a name has no colon, only the
administrator can add/delete an account (unlock first), no such account.  The
German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the
numbers.

Measured with a runner (setlocale + mcde_sys_shares_set on a missing folder,
mcde_sys_user_delete on a missing login): LANG=C "Only the administrator can
change what is shared." and "There is no account \"nosuchuser_xyz\".";
LANG=de_DE.UTF-8 "Nur der Administrator kann ändern, was freigegeben ist."
and "Es gibt kein Konto \"nosuchuser_xyz\"."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:12:31 +00:00
lotherk b674c3d2b7 McdeSys: the printer errors in the catalog, German measured (t0282)
printers.c's eighteen mcde_sys_fail calls are messages 43-56 of mcdesys.cat
now: no place for the printers, no CUPS (lpstat/lpadmin), CUPS did not answer
or did not take the default printer/the printer/the removal, no printer was
named, the default printer / adding / removing needs the administrator, the
printer's name and address must be plain, no mDNS browser and the browser did
not answer.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Measured with a runner (setlocale + the public calls):
LANG=C: "The printer's name and address must be plain (letters, digits, - and
_; ipp://...)." and "No printer was named."; LANG=de_DE.UTF-8: "Name und
Adresse des Druckers müssen schlicht sein (...)" and "Es wurde kein Drucker
genannt."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:05:42 +00:00
lotherk 22aaaa5d84 McdeSys: the sound errors in the catalog, German measured (t0282)
sound.c's four error sentences are messages 39-42 of mcdesys.cat: the sound
server tells no volume, there is no sound file "%s", no player is installed,
cannot start %s.  The German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the numbers.

Measured with a runner (setlocale + mcde_sys_sound_play on a missing file):
LANG=C "There is no sound file \"/nonexistent/ding.wav\"."; LANG=de_DE.UTF-8
"Es gibt keine Tondatei \"/nonexistent/ding.wav\"."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 10:59:19 +00:00
lotherk dcee228451 McdeSys: the backup errors in the catalog, German measured (t0282)
backup.c's 23 mcde_sys_fail calls are messages 22-38 of mcdesys.cat now:
cannot write, the backup disk mounted somewhere else, the six
administrator sentences (set up, change, switch, back up, look into,
restore), BorgBackup missing, password too short, choose a disk, bad numbers,
crontab/dtbackup missing, no disk set up, nothing to restore, cannot go to.
The German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg uses the
same numbers; these texts are shown in System Settings (Xft), so they carry
proper umlauts.

Measured with a runner (setlocale + the public calls):
LANG=C: "Only the administrator can set up the backup.", "Only the
administrator can switch the backup.", "Only the administrator can restore
from the backups."; LANG=de_DE.UTF-8: "Nur der Administrator kann die
Sicherung einrichten.", "... die Sicherung umschalten.", "... aus den
Sicherungen wiederherstellen."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": FAIL 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 10:52:58 +00:00
lotherk 7507b51850 McdeSys: the network mount errors in the catalog, German measured (t0282)
netmount.c's twelve sentences are messages 10-21 of mcdesys.cat now: no
computer name, showmount/smbclient/sshfs/mount_afp/NFS/umount not there, no
list of shares for that kind, no address this computer can connect to, a
password that cannot be used, a scheme that is not there yet, no folder.
The German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the
same numbers (ASCII in these low-level texts: they also reach programs
without a render table).

Measured with a small runner (setlocale + the public calls):
LANG=C: "bogus:// cannot be connected to here yet.",
"\"smb://bad host/share\" is no address this computer can connect to.",
"No folder."; LANG=de_DE.UTF-8 (localedef/LOCPATH): "bogus:// kann hier noch
nicht verbunden werden.", "\"smb://bad host/share\" ist keine Adresse, zu
der dieser Rechner verbinden kann.", "Kein Ordner."
make mcde-linux MCDE_DIRS="install lib/McdeSys", "install
programs/localized/C/msg" and "check lib/McdeSys" exit=0; MCDE_DIRS=plist:
"3487 installed names under dt/, 8682 in the PLISTs", ok.
2026-11-16 10:46:34 +00:00
lotherk e6202a8019 McdeSys: the tool errors come from a catalog, German measured (t0282)
common.c's tool runner built its sentences as format strings, so every
dialog that shows mcde_sys_error() was English.  They are set 1 of
lib/McdeSys/mcdesys.msg now (9 messages: not there, cannot start, failed
with status, no pipe, no answer within N seconds, out of memory, the program
is not installed, the connector ended without an answer, cancelled), read by
lib/McdeSys/text.c (mcde_sys_msg, plain catopen/catgets; NLSPATH is set the
way DtSvc does when the session has none, from -DMCDE_DT_TOP=$(prefix)).
The German copy is programs/localized/de_DE.UTF-8/msg/mcdesys.msg, built by
msg.C.am into lib/nls/msg and listed in the PLIST (C plain, ${PLIST.nls} for
German).  A library does not call setlocale; the program does.

mcdesoundd gets no catalog: its only text is the log of a background daemon,
and the system layer stays English (AGENTS.md, language point 6).

Measured: a small program (setlocale + mcde_sys_run) prints
"/nonexistent/tool is not there." and "/bin/false did not succeed
(status 1)." with LANG=C, and "/nonexistent/tool ist nicht vorhanden." /
"/bin/false war nicht erfolgreich (Status 1)." with LANG=de_DE.UTF-8
(localedef/LOCPATH).  make mcde-linux MCDE_DIRS="install lib/McdeSys" and
"install programs/localized/C/msg" exit=0; MCDE_DIRS=plist: "3487 installed
names under dt/, 8682 in the PLISTs", ok.
2026-11-16 10:38:43 +00:00
lotherk b61e22457f MCDE mouse pane: wheel labels unswapped, touchpad settings (t0288)
Konrad, 2026-11-16: scrolling looked inverted in the settings, and the
touchpad could not be configured (three buttons or two with taps/gestures).

- The wheel radio pair had its texts swapped: without the button 4/5 swap a
  wheel turned towards you sends button 5 and the content goes down, so that
  is the "towards you" state.  The labels now sit on the right widgets.
- McdeSys gains mcde_sys_touchpad_get/set (McdeSys.h): tap to click, two
  fingers as no/right/middle button (pms(4) hw.synaptics.tap_to_click and
  .two_fingers_emulation) and a scrolling strip at the pad's edge
  (.vert_scroll_percent/.horizontal_scroll_percent, 7 or 0).  The sysctls are
  CTLFLAG_READWRITE, so a write as a user answers MCDE_SYS_EPERM with a
  sentence; a system without the interface answers ENOTSUP (Linux: libinput
  keeps its own, per device).
- The Mouse tab builds a Touchpad section from the read values (tap, the
  pad's own buttons / right / middle, the scrolling strip) and writes
  ~/.dt/touchpad only after a successful set; the note says when the
  administrator is needed.  dtsystemsettings -apply-touchpad puts the saved
  values back, for a boot script or an unlocked session.

Measured: make mcde-linux MCDE_DIRS="install lib/McdeSys" and
"install programs/dtsystemsettings" exit=0; the NetBSD branch of netbsd.c
passes x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's
sysroot; the Mouse tab on Linux shows the corrected wheel pair and "This
system keeps the touchpad settings outside the desktop" (screenshot), and
with a stub backend in the build tree only for the picture, the section with
tap, fingers and strip; dtsystemsettings -apply-touchpad with a saved file on
Linux answers the ENOTSUP sentence, rc=1; with no file rc=0.
2026-11-16 09:14:44 +00:00
lotherk d2ada23e5a McdeSys: device events on NetBSD through drvctl(4) DRVGETEVENT
mcde_sys_disk_events() opens /dev/drvctl O_NONBLOCK on NetBSD; the
events come as an ioctl, not read(2), so the new
mcde_sys_disk_event_read() is the one call a program uses: Linux reads
the uevent, NetBSD asks DRVGETEVENT and turns the property list into the
same 'device-attach sd0' line (the way devpubd(8) does it).  dtwm's
desktop and test_sysinfo use the new call; the cross compiler builds
events.c and netbsd.c for NetBSD and the Linux tests stay green.
2026-11-16 07:25:28 +00:00
lotherk 0977cc954a MCDE: desktop icons for computer, disk mounts, media and network mounts
McdeSys: McdeSysMount and mcde_sys_mounts() -- /proc/mounts on Linux
(label from /dev/disk/by-label, removable from /sys/block), getmntinfo
on NetBSD; pseudo file systems are marked volume=0, network file systems
network=1; test_sysinfo checks that / is mounted once.

dtwm: WmMcdeDesktop.c is the 4Dwm-style desktop: one override-redirect
window per icon in the top right corner, filled from the top down, then
the next column left; XPM glyphs; labels cut with '...'; the computer
('/'), disk mounts, removable media (mounted or not), network mounts and
the person's files from ~/.dt/Desktop and ~/Desktop; right click menu
(Open, Open Home, Show on All/This Workspace, Unmount, Move to Trash);
drag and drop; every icon's place and workspace in ~/.dt/desktop.conf
(kept for good); not mounted media are mounted by the double click.
WmWrkspace.c calls McdeDesktopWorkspaceChanged() on a workspace change.

tools/mcde-shot.sh: MCDE_DESK_TEST_MOUNTS, MCDE_DESK_TEST_DISKS,
MCDE_DESK_TEST_DESKTOP and MCDE_SHOT_KEEP_HOME for the tests.
2026-11-15 22:22:20 +00:00
lotherkandClaude Sonnet 5.5 6676102ec8 McdeSys: network and disk counters for the activity window (t0091, McdeSys part 2)
mcde_sys_net_io: bytes and packets each way, for each interface (the loopback
too).  mcde_sys_disk_io: bytes and operations read and written, for each whole
disk (no partitions; no loop, ram or zram devices).  The difference of two
readings over the seconds between them is the rate the Network and Disk
Activity tabs draw.

NetBSD (read in the tree first): the interface counters are the struct if_data
of the link-level address from getifaddrs(3) (ifi_ibytes, ifi_obytes,
ifi_ipackets, ifi_opackets); the disks come from sysctl hw.iostats
{CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl)}, asked for its size and then for
the array (usr.bin/vmstat/drvstats.c:183-188, :323-328), type IOSTAT_DISK,
rbytes/wbytes/rxfer/wxfer (sys/sys/iostat.h).  Cross-compiled with
x86_64--netbsd-gcc -Wall -Wextra: no diagnostic.  NEVER RUN on NetBSD.
Linux: /proc/net/dev (64-bit counters), /proc/diskstats (512-byte sectors),
whole disks only: those with a directory in /sys/block.

test_sysload (make check, 7 of 7) now also: 2 MB sent over a TCP connection on
127.0.0.1 raise the loopback's rx and tx bytes by at least 2,000,000 and its
packets; 8 MB written and fsync'ed next to the test move the disks' write
counters (measured here: 25,595,904 bytes for 8 MB -- the device-mapper volume
and the physical disk under it are both whole devices, so a window should not
add them up); the counters never go back by name; the write check says SKIP
instead of failing where the file system has no disk.  Mutants: rx bytes taken
from packets fails 2 checks, write bytes taken from the read sectors fails 1,
sectors not multiplied by 512 fails 1.

Not done of t0091: the program (programs/dtactivity).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 05:03:08 +00:00
lotherkandClaude Sonnet 5.5 ecef3334a2 McdeSys: CPU times, memory and signals for the activity window (t0091, McdeSys part)
mcde_sys_cpu_times: one McdeSysCpu (user, nice, system, idle, other ticks since
boot) per processor.  mcde_sys_memory: bytes, total = free + cached + used (cached
is what the system gives back when asked), and swap.  mcde_sys_signal: TERM, KILL,
STOP, CONT, HUP or INT to a process above pid 1 -- never init, a group or "all my
processes" (kill(2) with 0 or a negative number is refused before it is asked);
EPERM for another user's process, ENOENT for one that is gone.

Backends, read in the tree before they were written:
- NetBSD: kern.cp_time given room for every CPU (hw.ncpu x CPUSTATES x 8 bytes)
  returns each CPU's counters in CP_ order (sys/kern/init_sysctl.c,
  sysctl_kern_cptime: "alternately, you can pass an additional mib number and get
  cp_time for that particular processor"; a buffer of one CPU's size gets the
  SUM); memory from vm.uvmexp2 (struct uvmexp_sysctl, pages; top(1) reads it
  too, external/bsd/top/dist/machine/m_netbsd.c).  Cross-compiled with
  x86_64--netbsd-gcc -Wall -Wextra: no diagnostic.  NEVER RUN on NetBSD.
- Linux: /proc/stat (cpuN lines, "other" = iowait + irq + softirq + steal),
  /proc/meminfo (cached = MemAvailable - MemFree, else Buffers + Cached).

test_sysload (make check, 7 of 7): the memory adds up and agrees with
sysconf(_SC_PHYS_PAGES) within 5 per cent; the CPU counters never go down and
0.4 s of work of the test's own shows as at least 5 ticks; children are stopped
(state T in mcde_sys_processes), continued and ended by TERM, KILL, HUP and INT
(the exit status says which signal); pid 1, 0, -1, a group and a bad signal are
refused; a waited-for child is "gone"; another user's process answers EPERM (to
SIGCONT only, and only when the test is not run by root).  Mutants: memory
without the x1024 fails 2 checks, a parser that loses the busy ticks fails 1.
Not checkable on a busy host: that user, nice, system and idle are not swapped
(the shares depend on the load); the NetBSD backends are not run.

Not done of t0091: mcde_sys_disk_io and mcde_sys_net_io (the Disk Activity and
Network tabs), and the program itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 05:00:36 +00:00
lotherkandClaude Sonnet 5.5 c7b9bcd0ae McdeSys: a Wi-Fi name that starts with "-" is no argument for nmcli (t0081)
The Linux mcde_sys_wifi_join passes the network name to
"nmcli device wifi connect NAME ...".  The name of an access point is what the
neighbour's device broadcasts.  Measured with nmcli 1.56.1:
  nmcli device wifi connect --ask password PW ifname IF
  -> "Error: invalid extra argument 'PW'" -- the name was taken as the option
  --ask (a name of -x, --help or - is taken as a name; no effect).
"--" in front is no remedy: nmcli takes the "--" for the name ("invalid extra
argument 'Home'" for a normal name).  The password is safe: it is the argument
of the keyword "password" whatever it starts with.

So the Linux branch refuses a name that starts with "-" (mcde_sys_wifi_ssid_arg_ok
in net.c, with the old 1..32 byte rule); the NetBSD branch does not call nmcli.
A legitimate network called "-something" cannot be joined from System Settings
on Linux; the message is the old one ("The network name cannot be used").
test_netinput: 11 more checks; make check 6 of 6; with the dash rule removed the
test fails (checked with a mutant).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 04:56:03 +00:00
lotherkandClaude Sonnet 5.5 378a6bc805 McdeSys: an AFP password no longer shows in ps(1) (t0077, A)
mcde_sys_net_mount built afp://user:PASSWORD@host/vol and that was argv[1] of
mount_afp: everyone on the computer could read it with ps(1) for as long as the
mount ran (measured with a fake mount_afp and a slow tool: "mount_afp
afp://alice:TopSecret-42@nas.local/Volume /tmp/mp-test").  The address says
"-" now, and the password is one line of the tool's standard input:
afpfs-ng's mount_afp asks getpass(3) for a password "-" (fuse/client.c), and
getpass reads the standard input where the process has no controlling terminal
(src/lib/libc/gen/getpass.c:106-112: "Try to use /dev/tty if possible;
otherwise read from stdin").  So no change in the fork.

For that the tool must have no controlling terminal even when the program was
started from a terminal: the job runner is a session of its own now (setsid
instead of setpgid; the group is still the runner's, cancelling still ends the
tool; kill of the pid too, for the moment before the setsid), and
mcde_sys_net_mount is _start plus waiting, so it detaches the same way.  The
restriction against "@", "/" and ":" in an AFP password is gone (they were in the
address); a line break or more than 297 characters is refused for sshfs and
mount_afp alike.

Measured with the fake mount_afp (records argv, whether /dev/tty opens, what
getpass returns): argv[1] afp://alice:-@nas.local/Volume, getpass returned the
password, also "pa:ss@w/rd 1"; under a pseudo-terminal the OLD code kept
"controlling terminal present" and the new one has "no controlling terminal"
and still gets the password; no password -> afp://alice@nas.local/Volume, no
getpass; a line break -> refused.  ps during a mount: old code showed the
password in mount_afp's line, new code "-".  test_netmount: 6 cases of
mcde_sys_net_afp_address (a function that is not given the password, so it
cannot put it into the address); make check 6 of 6 (test_job's cancel test still
passes); the dtfile timeout/Escape scenario still leaves 0 tool processes.

Not done of t0077: B (the /tmp/afp_server-<uid> socket and /tmp/fuse_stderr of
afpfs-ng), and the real mount_afp against a netatalk server (the fake stands
in; only the standard-input and argv behaviour is measured).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 04:45:29 +00:00
lotherkandClaude Sonnet 5.5 5b2f0f4e8e McdeSys: the Wi-Fi input checks are a function the tests can reach (t0081, a)
The checks that keep a typed network name and password out of
wpa_supplicant.conf and rc.conf (netbsd.c, mcde_sys_wifi_join) sat inline in
the NetBSD branch, behind geteuid() != 0: no test of the build could run them.
They are mcde_sys_wifi_config_ok in net.c now (one implementation for the file
that is built on every system), the NetBSD branch calls it, and the new
test_netinput.c runs 46 checks as an ordinary user: name 1..32 bytes (33
refused), passphrase none or 8..63 (7 and 64 refused), a quote, a backslash or
a newline in either (also a whole injected "network={" block), the interface
name (lower case and digits only), plus the two helpers net.c already had
without a test: mcde_sys_net_ifname_ok and mcde_sys_net_prefix (a
non-contiguous netmask, trailing text).

One behaviour change, found by writing the table: an EMPTY interface name
passed the inline check (strspn("") == strlen("")) and would have given
wpa_supplicant_flags="-B -s -i  -D bsd ..."; it is refused now.

Measured: make check 6 of 6.  Mutation check: with the SSID limit raised to 33,
with the empty-name guard removed, with the passphrase minimum 7, and with the
quote check left out of the passphrase, test_netinput fails (1, 1, 1 and 2
cases); the real code passes.  netbsd.c and net.c compile for NetBSD
(x86_64--netbsd-gcc) without a diagnostic.  Not run on NetBSD.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:24:54 +00:00
lotherkandClaude Sonnet 5.5 b2dab1ad71 McdeSys: no fixed /usr/pkg in the sources; configure says where pkgsrc is (t0081, c)
19 paths in lib/McdeSys (borg, dtbackup, pactl, paplay, smbclient, sshfs,
mount_afp, lpstat, lpadmin, avahi-browse, sysupgrade, smbd, netatalk, atalkd,
the rc.d examples, smb.conf, afp.conf) were written as "/usr/pkg/...".  They
are MCDE_PKG_PREFIX "/bin/borg" and MCDE_PKG_SYSCONFDIR "/afp.conf" now:
configure.ac has --with-pkg-prefix (default /usr/pkg) and --with-pkg-sysconfdir
(default PREFIX/etc), lib/McdeSys/Makefile.am hands them to the library as
-D, and the recipe passes --with-pkg-prefix=${PREFIX} and
--with-pkg-sysconfdir=${PKG_SYSCONFDIR} (the same way --with-local-bindir is
passed).  The sources do not include config.h, hence the -D.

Measured: x86_64--netbsd-gcc -S of backup, netbsd, sound, netmount and printers
before and after: the string constants are byte-identical (490 strings, the same
17 distinct /usr/pkg paths).  With -DMCDE_PKG_PREFIX=/opt/pk and
-DMCDE_PKG_SYSCONFDIR=/etc/pk: no /usr/pkg left, 15 paths under /opt/pk, the two
configuration paths under /etc/pk.  Native: configure regenerated, the
Makefile has MCDE_PKG_PREFIX = /usr/pkg, make check 5 of 5, PLIST pre-check
ok (3208 installed names, 8396 in the PLISTs).  git grep '"/usr/pkg' in
lib/McdeSys: nothing.

Not done of t0081: the message catalogs; the wifi_join checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:21:33 +00:00
lotherkandClaude Sonnet 5.5 bd41face71 McdeSys: an sftp user that starts with "-" no longer reaches sshfs as an option (t0081, tests)
ParseUrl refused a host that starts with "-" but not a user: the first argument
of sshfs is "USER@HOST:PATH", so sftp://-p22@host/ gave it "-p22@host:/", an
option.  Found by the table test this commit adds: mcde_sys_net_url_ok (the
tests' view of ParseUrl, private.h) with 22 addresses -- sftp/nfs/afp, IPv6
written bare, an empty user, a user or host that is an option, a space, ';',
'$(id)', a second '@', a newline in the path, no host, no scheme, a scheme of 16
characters, a host of 255 (kept) and 256 (refused) characters, NULL.
Red before the fix: exactly sftp://-l@host/ and sftp://-p22@host/ accepted;
green after: make check 5 of 5 (34 ok lines in test_netmount).

Not done of t0081: the checks of mcde_sys_wifi_join (netbsd.c:534ff, SSID 33
bytes, quotes, backslash, passphrase 8..63) -- they come after geteuid() != 0
and are NetBSD-only (the Linux branch checks the length only and must keep
quotes in a passphrase), so no test of the build can reach them without a
shared validator; catalogs and @PREFIX@ untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:58:27 +00:00
lotherkandClaude Sonnet 5.5 cc770d000e dtfile: a mount no longer freezes the window; Connecting dialog, Cancel, Dtfile*connectTimeout (t0080 item 4)
mcde_sys_net_mount ran in the Xt callback and waited for sshfs/mount_afp
without a limit: a server that is gone froze the window for as long as the
tool lived (measured: the call returns after 20.0 s with a tool that sleeps
20 s; with one that never ends, never).

McdeSys: mcde_sys_net_mount_start/_job_fd/_job_finish/_job_cancel.  The tool
runs under a runner process (its own process group) that writes the answer
to a pipe: dtfile sets SIGCHLD to SIG_IGN (Main.c), where waitpid gives no
status.  mcde_sys_net_mount and _start share one plan (MountPlanFor).
test_job (make check, 5 of 5 pass) covers success, failure, a missing tool,
a password on stdin, and cancel with the tool AND what it started gone, with
SIGCHLD default and ignored; without the group kill it fails (mutant run).

dtfile: _McdeNetMount (NetView.c) for all three mounts (network view,
Connect to Server, column view): a modal "Connecting ..." dialog with Cancel
(also close button and Escape), the descriptor as Xt input (no timer
polling), one time-out, Dtfile*connectTimeout, 20 s, 3..600 (app-defaults,
man page).

Measured (real dtfile on Xvfb, fake sshfs that sleeps 40 s, connectTimeout
4): the dialog shows and repaints when moved; the time-out gives "Could not
connect: The server did not answer within 4 seconds.", Escape gives
"Could not connect: Cancelled."; sleep processes while connecting 1, after
the time-out 0, after Escape 0; no dialog left.  One first run showed a 40 s
stall of the whole session after Return (import blocked too); not
reproduced in three further runs, cause unknown.  Cross compile for NetBSD
(x86_64--netbsd-gcc, the build's flags): netmount.c and NetView.c without a
warning; common.c's old settimeofday declaration warning is not new.  Not
done: the NFS and AFP tools (only sshfs was faked), the afp://10.255.255.1/
case of the task with a real mount_afp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:28:27 +00:00
lotherkandClaude Sonnet 5.5 14a25a4ac2 McdeSys: the bar's status reads end after 2 s (t0080)
A hung pactl made mcde_sys_volume_get wait 40 s (pactl info, then
get-sink-volume, then get-sink-mute; measured with a fake pactl that
sleeps 20 s in a private mount namespace).  The reads the bar repeats to
show a state -- volume (pactl, mixerctl, amixer), Bluetooth (bluetoothctl,
btconfig), the Wi-Fi network (iw) -- now use mcde_sys_capture_limited with
MCDE_SYS_STATUS_SECONDS (2 s, private.h).  Pactl() keeps its answer: a
"yes" until a read fails, a "no" for 30 s, so a stopped server costs
one 2 s wait, then the mixer answers.

Measured after: pactl hangs: 2.0 s, then 0.0 s (mixer); amixer hangs:
2.0 s a call, rc=-6; bluetoothctl hangs: 2.0 s, present=1 on=0; no
shim: 0.0 s.  make mcde-linux check: 4 of 4 tests pass.  Wi-Fi scan and
join, network configuration, disks and updates keep the unlimited call:
they do real work.  AGENTS.md says so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:06:43 +00:00
lotherkandClaude Sonnet 5.5 b0bff21e62 MCDE McdeSys: mcde_sys_processes, the list of processes (t0091, first part)
pid, parent, owner, command name, state, threads, real and virtual memory in
bytes, CPU time in ms.  NetBSD: sysctl KERN_PROC2 the way libkvm's kvm_getproc2
asks (size, then the buffer by count, ENOMEM -> again), CPU time from p_rtime_*
as ps(1) does (print.c:1059), state from p_realstat and the LWP's p_stat.
Linux: /proc/PID/stat read after the LAST ')', memory from statm.

Measured: test_processes (this process, init, a zombie until waited for, a
sleeping child named 'a b)c', SIGSTOP as T, SIGCONT back) and the three other
McdeSys tests PASS, mcde-linux exit=0.  Against ps -eo for every process in both
lists: 631 compared, parent, owner, threads, RSS, state and CPU time all agree.
First version used stat's rss: on this kernel it is larger than VmRSS/statm
(126 of 632 processes more than 10 % off), so statm is read.  The NetBSD code is
compiled against the NetBSD sysroot with x86_64--netbsd-gcc -Wall -Wextra
(all of netbsd.c, exit 0), not run there.  Also <ctype.h> in netbsd.c and
linux.c: isspace() was used undeclared (an error with GCC 14, masked in the
build by -Wno-error=implicit-function-declaration).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 23:45:47 +00:00
lotherkandClaude Sonnet 5.5 86ff325ecb MCDE McdeSys: the root update takes only a directory, file:/// or https:// as its source (t0078)
sysupgrade-1.5 fetches with ftp and unpacks with tar as root and checks nothing;
pkg_add -uu trusts the packages it is given (docs/reference/update-verification.txt).
mcde_sys_update_source_ok (common.c, fail closed: the scheme in lower case, only
[A-Za-z0-9._~:/@%+,=-]) is asked by mcde_sys_update_check, which then does not
even contact a refused source, and by mcde_sys_update_apply, which refuses before
any root action.  http://, ftp://, ssh:// and shell or query characters are out.

Measured: make mcde-linux MCDE_DIRS='check lib/McdeSys' exit=0, PASS 3 of 3
(test_updatesource has 28 cases, build/logs/mcde-linux-2026-11-14-t0078.log);
netbsd.c does not build on this host, its update section compiled alone with
-Wall -Wextra gives no warning.  This does not verify any signature: that needs
a key and Konrad's decision (t0078 steps 2 and 3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:15:05 +00:00
lotherkandClaude Sonnet 5.5 46606008b5 MCDE DtSvc: max_buf grows its buffer to the size asked for, not the old one (t0216)
CDE 2.5.3's max_buf (lib/DtSvc/DtUtil1/Dts.c) called realloc(buf, mb_size)
with the OLD size and only then stored the new one, so the buffer stayed at
MB_SIZE (100) bytes and DtDtsDataToDataType's strncpy and terminator wrote past
it.  dtwm aborted at start with 'malloc(): unsorted double linked list
corrupted' while the front panel read the data types.

Measured: valgrind on dtwm under Xvfb gave 'Invalid write of size 1, 0 bytes
after a block of size 100' (Dts.c:1321, block from max_buf Dts.c:303) and six
invalid-access contexts in all; after the change none, and dtwm runs 40 s under
valgrind and 8 s plain (before: status 134).  The two remaining reports are
struct and X-protocol padding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:07:01 +00:00
lotherk 319a490c1f MCDE DtSvc: the type of a host-qualified name, so icons and Trash see the file (t0194) 2026-11-14 18:59:04 +00:00
lotherk 8625f83d49 MCDE McdeSys: device events as a descriptor for the Xt loop (t0162) 2026-11-14 14:50:21 +00:00
lotherk 630cd2f75d MCDE dtconsole: the log viewer with an inotify watch (t0123) 2026-11-14 14:41:22 +00:00
lotherk 938253e9bd MCDE: drives on the desktop, the bar's user menu and search (t0126)
dtwm draws the volumes of the computer in a small window in the top right
corner under the bar (new programs/dtwm/WmMcdeDesktop.c): one tile for each
mounted volume from mcde_sys_disks -- the drive glyph, the volume's name on
a background field of its own (no shadow, no transparency), the chosen one
boxed.  A second click within 500 ms opens the volume in dtfile
(fork/execv, no shell).  The list is read when the window manager starts;
a volume plugged in later needs the mount events of t0080/t0083.
MCDE_DESK_DEBUG=1 prints what it found (tools/mcde-shot.sh passes it into
the session).

The bar's right end gained the reference's two parts: a person cascade with
the login name (the passwd entry first: a session started with an empty
environment has no USER -- measured, the menu said "user"), Accounts... and
Log Out...; and a magnifier cascade with "Launcher (Command+space)"
(dtlaunch -show) and the settings.  Both are cascades because the status
area is a homogeneous menu bar and refuses any other child (measured:
"Attempt to add wrong child type").

McdeSys's Linux disk backend now lists lvm and crypt volumes; the root of a
host with LVM was missing from every disk list before (measured: only
/boot and /boot/efi stood on the desktop, the root now appears as
"System").

Measured under Xvfb with xdotool:
  - the desktop shows efi, boot and System in the corner
    (docs/screenshots/leopard/Desktop-mcde.png);
  - a double click on System opens "File Manager - kitt:ROOT";
  - the person menu says "lotherk", with "Accounts..." and "Log Out...";
  - the magnifier opens its menu; "Launcher (Command+space)" starts dtlaunch
    (-show);
  - test_sysinfo lists the root volume; make lib/McdeSys, programs/dtwm,
    programs/dtbar exit=0.

Open (follow-ups): the front panel's running-program dots, the volume
hot-plug (t0083), and the desktop icons' text colour from the palette
(they use the session's background with black text today).
2026-11-14 13:39:17 +00:00
lotherk f37f703eb2 MCDE dtsystemsettings: the Printers pane, CUPS and mDNS (t0143)
New programs/dtsystemsettings/printers.c replaces the "printers" entry that
only started dtprintinfo:

  * the left list is the queues of CUPS (McdeSys mcde_sys_printers: lpstat
    -p and -d, parsed; the default is marked with a star and named in the
    status line), the right side is what is chosen -- state, location,
    model, whether it is the default and whether it is shared;
  * "Add Printer..." lists the printers mDNS finds (_ipp._tcp through
    avahi-browse -rtp, names unescaped: avahi writes \032 for a space in
    decimal), fills the queue name from the chosen one and shows its URI;
  * "Add", "Remove Printer..." and "Set as Default..." run in the terminal
    of su(1) (dtsystemsettings -add-printer NAME URI | -remove-printer |
    -set-default-printer), the pattern of the other root actions; adding
    uses the driverless model (lpadmin -p NAME -E -v URI -m everywhere);
  * "Print Queue..." opens dtprintinfo -all, CDE's queue view.

McdeSys gained mcde_sys_printers, _printer_add, _printer_remove,
_printer_default and _printers_discovered (lib/McdeSys/printers.c, built for
every backend).  Names and URIs are checked before they reach an argument
list (letters, digits, - and _; ipp://, ipps://, socket://, usb:// without
spaces or shell punctuation); the mDNS output is only parsed.

The task asked for libcups rather than command lines; measured 2026-11-14 on
the build host, cupsGetDests2() returns 0x2 and leaves num_dests untouched --
through dlopen and linked directly -- while _cupsGetDests() finds no queue
and lpstat -p lists the two the desktop has.  The library path is a
follow-up, and AGENTS.md carries the measurement.

Measured under Xvfb with xdotool, against the host's CUPS:

  - the pane lists HP_LaserJet_M110w_CC1016 (idle) and Samsung_CLP-365
    (disabled, its reason shown), the default star on Samsung and "Default
    printer: Samsung_CLP-365" below -- the same two and the same default that
    lpstat -p / lpstat -d print; the detail side shows the chosen queue
    (docs/screenshots/leopard/System-Preferences-Print-and-Fax-mcde.png);
  - "Add Printer..." finds "HP LaserJet M110w (CC1016)" over mDNS, choosing
    it fills the name HP_LaserJet_M110w_CC1016 and the URI
    ipp://192.168.1.147:631/ipp/print
    (docs/screenshots/leopard/System-Preferences-Print-and-Fax-Add-Printer-
    mcde.png);
  - "dtsystemsettings -set-default-printer Samsung_CLP-365" as the user
    answers "The default printer was not changed: The default printer needs
    the administrator." -- the root step runs in the su terminal;
  - test_sysinfo prints both queues and the discovered printer;
  - make lib/McdeSys, programs/dtsystemsettings exit=0; check lib/McdeSys:
    test_sysinfo and test_netmount PASS.

Open (follow-up): printing a test page, the fax/Bluetooth/AppleTalk printers
of the reference, the NetBSD CUPS path, and adding a queue verified in a VM
with an IPP printer.
2026-11-14 13:27:22 +00:00
lotherk ec322652d3 MCDE dtmail: the settings window, General and Viewing (t0138)
dtmail opens the shared settings window (lib/DtWidget/McdePrefs.c) with
`dtmail -prefs`: a row of icon tabs, the page under them, no OK or Cancel.
The argument is taken out of argv before Xt sees it, and RoamApp::initialize
returns after building the window -- no mailbox and no ToolTalk are needed
for it.

  General  Default email reader (dtmail, Thunderbird, Evolution, mutt,
           xdg-email), Check for new mail (Manually, 1, 5, 15, 30, 60
           minutes), New mail sound (the events of the session's theme, a
           click plays it), Play sounds for other mail actions, Show the
           unread count in the front panel, Downloads folder, Remove
           unedited downloads, and what a search includes (Trash, Junk).
  Viewing  Show message headers (All/Brief/Full), the order of the list,
           the preview pane.

Values are kept as English KEY=VALUE in ~/.dt/dtmail.conf (McdePrefsConf),
the labels themselves (mailreader=Thunderbird), so the file stays readable.
dtmail's CDE Options dialog stays for the retrieval details; these keys are
the one pattern every MCDE program has, and wiring each into dtmail's own
option system is a follow-up.

McdePrefs grew what dtmail needed and the measurements found:

  * the page is a vertical XmPACK_COLUMN row column of rows; a row is a form
    of its own, made by McdePrefsRowBegin()/McdePrefsRowEnd() -- a widget
    cannot be reparented, so a row cannot take one made elsewhere (the old
    chained-form rows overlapped with many rows);
  * the window takes the size of the chosen page (its children are measured
    after the page is managed) and the title is the page's name;
  * a tab click finds its window by walking up the widget chain to a shell
    whose XmNuserData is a Prefs -- XtParent(XtParent(w)) alone found
    nothing, so no tab did anything before (measured).

dtpad's settings use the same two calls now; its window still writes
~/.dt/dtpad.conf.

Measured under Xvfb with xdotool:

  - dtmail -prefs: the General page -- docs/screenshots/leopard/
    Mail-Preferences-mcde.png -- and after a click on the Viewing tab the
    title is "Viewing" and the window 356x275 instead of 430x634
    (docs/screenshots/leopard/Mail-Preferences-Viewing-mcde.png);
  - Default email reader -> Thunderbird: ~/.dt/dtmail.conf has
    "mailreader=Thunderbird";
  - the Downloads field typed to /tmp/Downloads and Return:
    "downloads=/tmp/Downloads";
  - "Play sounds for other mail actions" off and on again: "othersounds=0"
    then "othersounds=1";
  - dtpad's Wrap to fit: "wrap=1" in ~/.dt/dtpad.conf;
  - make check lib/DtWidget: test_prefs PASS; make lib/DtWidget, dtpad,
    dtmail exit=0.

Open (follow-up): the reference's other pages (Accounts, Signatures, Rules),
wiring the keys into dtmail's own options, and ~/.dt/defaults with a
mailto: action -- choosing Thunderbird here stores the choice, but the
mailto: link still goes to dtmail's own action.
2026-11-14 13:03:41 +00:00
lotherk 020dd9ff5d MCDE dtsystemsettings: Security, three tabs (t0157)
New programs/dtsystemsettings/security.c with the reference's three tabs:

  General     "Require password to wake this computer from sleep or screen
              saver" writes dtsession's lock time (_DtSetSmState with
              SM_STATE_LOCKTIMEOUT; the Screen Saver page reads and writes the
              same field, so the two pages show one setting).  On: the lock at
              the saver's time, or ten minutes without a saver.  "Use secure
              virtual memory" is NetBSD's vm.swap_encrypt through McdeSys
              (now and in /etc/sysctl.conf, root).  Automatic login and a
              log-out after N minutes are shown as what the desktop has:
              dtlogin always asks for a name and a password, and dtsession
              has no idle logout -- the pane says so and greys the controls.
  Encryption  the cgd(4) volumes of /etc/cgd/cgd.conf, and the sentence that
              encrypting a disk is a decision of the installation, not of a
              running system; changing a passphrase is a follow-up.
  Firewall    the npf(7) state (rc.conf npf=YES, /etc/npf.conf); the rules
              are a follow-up -- a fixed template with the shares of the
              Sharing page, never free text.

McdeSys gained the security state: mcde_sys_swap_encrypt_get/_set,
mcde_sys_cgd_volumes, mcde_sys_firewall_get.  netbsd.c implements them
(sysctl(8) vm.swap_encrypt, /etc/sysctl.conf through a KeySet() that rc.conf
now uses too, /etc/cgd/cgd.conf, rc.conf's npf), linux.c answers
MCDE_SYS_ENOTSUP with a sentence saying whose feature it is.
test_sysinfo prints all three.

The pane's icon is new: programs/icons/McdeLock.pm (a padlock, palette
colours); "security" is a real pane now, not a greyed entry.

Measured under Xvfb with xdotool (dtsession started in the session):

  - the lock checkbox: _DT_SM_STATE_INFO on dtsession's window before the
    click 0xfff, ... lockTimeout 0x0; after it 0x100 (SM_STATE_LOCKTIMEOUT),
    lockTimeout 0x258 (600 s); a second click puts it back to 0x0;
  - the three tabs and their content (docs/screenshots/leopard/
    System-Preferences-Security-mcde.png with the lock on, ...-Encryption-
    mcde.png, ...-Firewall-mcde.png);
  - test_sysinfo on this (Linux) host prints the three MCDE_SYS_ENOTSUP
    sentences -- the pane shows them instead of dead controls;
  - make check programs/dtsystemsettings: test_panes PASS; the Sound and
    Keyboard & Mouse panes still switch their tabs after the layout fix
    below;
  - make programs/dtsystemsettings, lib/McdeSys exit=0.

A Motif lesson, saved in AGENTS.md: a row column inside the pane area takes
the other orientation unless told, a child added later to a tight-packed
column goes into the next column, and a page managed for the first time after
its widgets were built keeps a height of one line.  The pane therefore builds
its page fresh inside an XmPACK_COLUMN container on a tab change; the same
XmNorientation, XmVERTICAL went into the Sound and Keyboard & Mouse page
containers.

Not measured, because this host is not NetBSD or has no root: swapping
vm.swap_encrypt, reading cgd volumes, the npf state and writing npf rules.
They are the follow-up task for the VM.
2026-11-14 12:44:32 +00:00
lotherk 63acc18853 MCDE: one settings window for every program, dtpad first (t0164)
lib/DtWidget/McdePrefs.c and include/Dt/McdePrefs.h: the reference's
preferences window -- a row of icon tabs from appconfig/icons/C (the active
one pressed), the tab's form under it, no OK or Cancel.  A tab's form is
built the first time it is shown; Escape closes, the close box only hides
it.  McdePrefsRow() puts a right-aligned label left of a widget and stacks
the rows; McdePrefsSeparator() draws the group lines.

Values are kept in ~/.dt/<prog>.conf as KEY=VALUE (English, the tab shown
last as lasttab=) -- McdePrefsConf.c does that without X, so test_prefs
tests it without a display: get/set, keep the other keys, replace instead of
doubling, no comment pile-up.

dtpad is the first user: Options > Preferences... opens two tabs, "Editing"
(Wrap to fit, Overstrike) and "Window" (Status line).  A change goes to the
Dt Editor at once, the Options menu's toggle follows, and the value is
written.  At start dtpad overlays ~/.dt/dtpad.conf over its X resources, so
the next start has it.

Measured under Xvfb with xdotool:

  - Options > Preferences... shows the icon tabs and the rows
    (docs/screenshots/leopard/dtpad-preferences-mcde.png);
  - switching "Wrap to fit" on writes "wrap=1" into ~/.dt/dtpad.conf (cat;
    the header is written once, lasttab=Editing is kept);
  - starting dtpad with "wrap=1" and "status=1" in that file shows the
    status line (Line: 1  Total: 1) without any menu being touched -- the
    change survives a restart;
  - Escape closes the window;
  - make check in lib/DtWidget: test_prefs PASS.

Open: dtfile's Prefs.c and dtcalendar (t0149, not built yet) are not moved
to it -- dtpad proves the building block; Command+, still finds a program's
menu entry through the old name heuristic instead of an explicit
registration.  Both are follow-up tasks.
2026-11-14 11:52:34 +00:00
lotherkandClaude Sonnet 5.5 d53ea094e7 licence: CNCL for what Makronix wrote itself
LICENSE at the root; the 103 files new in ext/src/mcde (none was in the CDE
import) carry the CNCL line instead of the LGPL notice.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 11:48:02 +00:00