Files
lotherkandClaude Sonnet 5.5 222417e6bb mcde: the work of the Makronix tree (27 commits since 118b19a171) merged into the fork
The plain-file ext/src/mcde of the Makronix tree carried dtphoto (layers, PSD,
clipboard shape, JPEG/GIF/XPM writers), dtbar, dtsystemsettings (Startup Disk,
dock), dtwm and icon changes that this fork did not have.  Resolved by hand:
dtphoto.c, McdeThumb.c, Thumb.h, dtsystemsettings, dtphoto.msg, AGENTS.md take
the Makronix side (a strict continuation of what the fork mirrored); the fork's
own changes are kept (M_PI guard and the front[] fix of 4e51d6dd, 'No
dttoolchest menu', DeskLowerBackdrops, distinfo until the next ext-dist).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 08:34:35 +00:00

78 KiB

ext/src/mcde -- MCDE, the Makronix Common Desktop Environment

What it is for

The Makronix fork of CDE 2.5.3 (IMPORT), on its way to a desktop that works as one (GOAL.md, "MCDE"): one System Settings, a software update, the small things that belong together. Makronix ships it in place of CDE; pkgsrc builds it on any platform. What each program does is in its source and in docs/MCDE-PROGRAMS.md (Makronix root); this file holds the rules. The state of the file before the refactor of 2026-11-13, with the per-feature narratives and test notes, is docs/reference/mcde-agents-history-2026-11-13.txt.

The philosophy -- binding (Konrad, 2026-11-09)

  1. CDE, Motif, Xlib, X11 only. No GTK, no Qt, no compositor, no scripting language as a requirement. Fast, and it runs on machines of 1995. GPU frugal: no compositing or animations, redraw on Expose only.
  2. C99 and POSIX (POSIX.1-2008, XSI where CDE already needs it). New code compiles with -std=c99 -D_POSIX_C_SOURCE=200809L and uses nothing beyond POSIX and the X/Motif libraries. MCDE runs on NetBSD and Linux. Exception: dtchat (decided 2026-11-16). The chat program needs TLS, XMPP, speech and video, which POSIX cannot provide. It may link libtls (security/libretls on both systems; the base carries OpenSSL, not libtls), libstrophe (chat/libstrophe), libopus (audio/libopus) and, optional at build time, libvpx (multimedia/libvpx), each behind exactly one module (dc_tls, dc_xmpp, dc_audio, dc_video); libcrypto (base OpenSSL) supplies X25519, Ed25519, HKDF and ChaCha20-Poly1305. Nothing else from outside POSIX/X/Motif, no GUI toolkit, no scripting runtime. The Telegram (TDLib, C++) and WhatsApp (whatsmeow, Go) adapters are separate packages and separate processes (programs/dtchat-telegram, programs/dtchat-whatsapp), never linked into the UI or the core. The decision and its reasons are in docs/reference/dtchat-architecture.txt; the tasks are scope mcde/dtchat.
  3. The operating system is behind one layer: lib/McdeSys. Everything that differs between systems (users, network, Wi-Fi, time zone, host name, services, update, power, sound, disks, sharing, backup) goes through the functions of include/Mcde/McdeSys.h. A program never calls useradd, ifconfig, wpa_supplicant, edits /etc/rc.conf or calls systemctl itself, and never has an #ifdef __NetBSD__. Each system has one backend (lib/McdeSys/netbsd.c, linux.c, plus disk_*.c); common.c is POSIX. A backend uses the system's own tools the documented way. A call that a program repeats to show a state (the bar: volume, Bluetooth, Wi-Fi) asks its tool through mcde_sys_capture_limited with MCDE_SYS_STATUS_SECONDS (private.h), never unbounded: a stopped sound server froze the bar for 40 s a read (measured, tasksd t0080; 2 s since).
  4. Installed with pkgsrc, in conflict with CDE: pkgsrc/Makefile has CONFLICTS+= cde-[0-9]*.
  5. One look: the MCDE palette generates the X resources and the GTK/Qt themes (programs/dtthemesync, XSETTINGS daemon); MCDE is the reference.
  6. Language: what a user sees may be translated; configuration, bindings and the system below are English only (Mod4<Key>, Shift<Key>, Ctrl<Key> in every app-defaults catalog, never translated). Visible strings come from a catalog: programs/dtbar/dtbar.msg (English) and the locale's copy in programs/localized/<locale>/msg/, built by programs/localized/*/msg with gencat and opened by catopen("dtbar", NL_CAT_LOCALE) -- the name without .cat, NLSPATH carries %L/%N.cat (dtbar sets it when the session has none). dtsystemsettings does the same for its categories, panes and the window title (dtsystemsettings.msg, 32 messages); it calls setlocale before its first message, because the window title is already an argument of XtVaAppInitialize and a catalog opened then would stay the C one (measured 2026-11-16). dtlaunch (dtlaunch.msg, 3 messages) has no libDtSvc to link, so it calls catopen/catgets itself and its Makefile passes CDE_INSTALLATION_TOP. dttoolbox (dttoolbox.msg, 2 messages: the window title, which is "dttoolchest", and the "no menu" label) does the same and calls setlocale in main before its first message; the menu labels themselves come from the person's chestrc, which is their file, not a catalog. dtphoto (dtphoto.msg, 5 messages: the toolbox title, the two status lines and the open/save errors) keeps its menus as the reference's (dtphoto.menu, docs/reference/photoshop-ui.csv) -- they are the look of the program, not its sentences. dtphoto reads and saves through one 8-bit RGB buffer (SetImageRGB, GetImageRGB) and converts colours through the visual's masks on TrueColor, or in one XQueryColors/ XAllocColor per distinct colour otherwise -- never one X round trip per pixel. Measured 2026-11-22 on Xvfb 1280x1024x24, a 1024x768 24-bit BMP with 589,824 distinct colours: dtphoto -selftest A B 20.3 s before the change, 0.046 s after; the round trip is byte-identical (2,359,350 bytes, 0 differing) and the selftest now compares every pixel, not a sample (/tmp/dtptest). The same reader takes 8-bit BMP (uncompressed and RLE8) and the first image of an ICO (1/4/8/24/32 bpp, alpha 0 composited on the document's background, a PNG-compressed icon refused), as dtpaint does; depth 8 (PseudoColor) is exact for 4 and 65536-colour documents alike. A document with more colours than the 256-cell colormap holds loses the excess, as any 8-bit picture must. The toolbox is wired end to end since 2026-11-22: selection is a bit mask, not a rectangle, so the lasso, the magic wand (colour flood, tolerance in colour distance), Select > Inverse and Edit > Clear all work on the same thing, and a command paints only inside the mask. Move drags the masked pixels; it snapshots the picture and the mask at the press and rebuilds from that snapshot on every motion event, because a rebuild from the last frame walks the pixels twice as far, and the release must not recompute the offset (a drag that ends on the frame gives a position outside the canvas, which moved the picture back). Crop drags a rectangle and crops to it on release. Type opens a prompt and draws one line with the GC font over an undo snapshot. dtphoto -movetest|-croptest|-typetest|-selecttest|-retouchtest|-layertest |-cliptest|-viewtest|-drawtest|-selmodtest|-optest|-menutest are the headless proofs (no display needed beyond Xvfb): exact pixel sets for wand/inverse/lasso/clear, a 10x10 block moved (10,5) with its mask and a background hole left behind, a crop to 20x30 that keeps only blue, a text line with dark pixels and an untouched corner, and all six retouching tools (blur, sharpen, smudge, dodge, burn, sponge) moving the pixel values in the expected direction. All six run green on depth 24 and depth 8. Retouching reads a patch around the dab through one GetImageRGB round trip, not one per pixel; measured 80 ms for a full 1024x768 open/save round trip on a busy host. The Image and Filter menus carry real operations since 2026-11-22, all through the same RGB buffer: Image > Adjust (Invert, Desaturate, Brightness/Contrast), Flip (horizontal, vertical), Rotate (180, 90 CW, 90 CCW, which swaps the document size), Image Size (nearest neighbour, the aspect kept from the width) and Canvas Size (the picture centred in the larger canvas, the border in the background colour). Filter > Blur/Sharpen are 3x3 convolutions (Blur More a gaussian-ish kernel, Sharpen More the strong laplacian), Stylize has Find Edges, Emboss and Solarize, Noise has Add Noise (a xorshift seed, so the same run gives the same bytes) and Median/Despeckle, Pixelate has Mosaic. The border pixels keep what they had -- a 3x3 window at the edge would fold outside the picture -- and every per-pixel operation honours the selection: the first four (invert, desaturate, brightness, solarize) did not, which is why they now share OpPerPixel and a new operation cannot forget the mask. A menu entry is bound by its full path, not its label: the reference has "Horizontal" in Image > Flip and in Layer > Type, and the label alone cannot tell them apart. CommandOf takes "menu/sub/item", the reader stores it in Item.path, and -menutest proves every path resolves to the command the callback switches on, that no path is claimed twice and that a path nobody knows stays CMD_NONE (206 paths, 0 doubled, measured 2026-11-22). The table ends at its NULL entry so the test walks it without knowing the length. DTPHOTO_CMDS=1 prints what the loaded menu file bound: 206 of 206, none on CMD_NONE. Every menu path in dtphoto.menu resolves, so a bound entry is a wired one. The test also reads dtphoto.menu itself and counts the entries that resolve to no command (206 items, 0 unbound, measured 2026-11-22): the table checked against itself can be green while a line in the menu file does nothing. Counter-check: Select/Grow on CMD_NONE makes the test print "1 unbound" and FAIL, so the count is not decoration. Window > Show Commands lists the command table itself (206 rows), not a hand-kept list, so the palette cannot drift from what the menu binds. XmLoc is the one place that casts a catalogue string for XmStringCreateLocalized: Tr promises const because its English fallback is a literal, and the widget asks for char *. Without it six dialogs warned; with it the file builds without a single warning. The View switches are read, not just flipped: SnapX/SnapY pull a marquee or crop drag onto the grid or a guide, DrawGuides paints the grid, the guides and the rulers on the canvas (not into the picture), and -viewtest checks the snapping arithmetic while -drawtest counts the pixels the decorations add on a real pixmap. A flag that only toggles itself is a menu entry that does nothing, which is why both tests exist. dtphoto -optest|-menutest are headless too: the operations are checked against the arithmetic (a hard edge blurred to 170, the same edge sharpened clamped to 255 and 0, a mosaic cell to its mean) and not against "the picture changed". -filtertest covers the other 43 filters -- the gaussian, motion, radial and smart blurs, unsharp and high pass, find edges, emboss, trace contour, facet, fragment, median, offset, clouds, crystallize, pointillize, color halftone, mezzotint, diffuse, extrude, tiles, wind, deinterlace, NTSC colours, dust and scratches, the nine distortions and the whole Image mode family -- and asks for a property rather than a change: grayscale leaves r == g == b, bitmap only 0 and 255, indexed 4 only the ladder 0/85/170/255, offset is a permutation of the picture (same sum and sum of squares), equalize never narrows the range, and inverting twice returns the picture. Two of those are judged against what the display can hold and not against the bytes put in: on a 256-cell PseudoColor map the second inversion drifts 42/255 on a 576-colour picture, which is the map's limit, so the involution is checked on a four-colour picture where the floor is 0, and grayscale is allowed the 10/255 the nearest-cell search costs. The filtertest prints the floor it measured (0 on TrueColor, 30 on PseudoColor here) instead of carrying a hand-picked tolerance. The same run covers the colour-model and layer entry points that used to sit outside every test: CMYK Preview must not flatten the picture to one colour, Gamut Warning paints a saturated ink in the warning grey 128 and leaves a printable pixel alone (checked on a picture built for it -- pure red beside neutral grey -- because the structure picture holds no colour at the edge of the gamut), the 5x5 Custom kernel with a single 1 in the middle is the identity, Perspective at 0% is the identity and at 50% reads the top-left from inside the picture, a 90 degree Affine rotation is a permutation (same sum and sum of squares) and the identity matrix changes nothing, and Drop Shadow leaves the picture's own pixels alone. All twelve run green on depth 24 and depth 8. OpAffine maps around (w-1)/2, not w/2: with the half-open centre a 90-degree turn of a 24-wide picture lost a whole row to the background (552 of 576 pixels hit), which -filtertest caught as "not a permutation" before the fix. Every sampler that maps by inverse mapping needs the same centre, or an edge falls off. The zoom magnifier doubles on the left button and halves on the right (12%-800%), the hand pans the view, and both say what they did on stderr so a mouse-driven test can read the result. The Select menu's morphology works on an exact euclidean distance field (two passes, then the distance to the nearest selected and the nearest unselected pixel), so Expand, Contract, Border, Smooth, Grow, Similar and Feather are arithmetic, not guesses. Feather needed a second layer: one bit per pixel cannot carry a soft edge, so selCover holds 0-255 beside the bit mask and every consumer -- OpPerPixel, the gradient, PaintMask -- mixes by that coverage instead of cutting at the bit. -selmodtest checks the numbers (a 5x5 block contracted by 1 loses its four corners and nothing else, a 2 px band from Border, Grow taking the neighbouring colour and Similar the whole picture). Window > Show Options opens the Options box, which is where the tool parameters live: pencil and eraser radius, the wand's tolerance (which Grow/Similar read too), the retouch radius and strength, and the gradient as linear or radial. Every field writes straight into the variable the event handler reads, so there is no second copy, and each edit says dtphoto: options <name>=<value> on stderr. The box is built by a fixed row list, and a row returns the FIELD, not its label: a text field is taller than its label, so attaching the next row to the label stacked the fields on top of each other and the tolerance field was unreachable (measured 2026-11-22, the click landed in the eraser field). DTPHOTO_OPTIONS=1 opens the box at startup, which is how the test reaches it without a mouse. The layer stack is real and the palette shows it (2026-11-22): one row per layer, the top of the stack first, an eye that hides a layer and a name that makes it active. Before this the palette was a single label and a layer could only be reached through the Layer menu. The rows are rebuilt where the stack changes (new, duplicate, delete, merge), never from inside a row's own callback -- that would destroy the widget whose handler is running. A layer carries coverage (0-255 per pixel) as well as RGB, because an empty layer has to let the one below show through: without it a new layer was a white sheet that hid the picture, and LayerAbsorb copied the whole composite into it, so the layer below appeared twice. The background has no coverage buffer (it covers everything), a new layer starts with an empty one, and WritePatch sets the coverage of the layer being painted so a stroke is opaque while the rest of the layer stays clear. Layer Options sets opacity and blend mode (0 normal, 1 multiply, 2 screen) through FieldDialog and without absorbing first: a property is not new pixels, and reading the composite back into the layer baked the old blend in, so 50% showed 127,0,0 and multiply over white went black (measured 2026-11-22). -layertest drives the real CanvasInput in the order that matters -- stack first, then the stroke -- because a LayerEnsure after the stroke reads the pixmap back into the layer and hides the fault: eleven checks, that the stroke lands in the painted layer and not the one below, that every visible layer is composited whichever is active, that hiding it brings the background back, that the palette holds one row per layer and a click on the top row makes that layer active, and that opacity 100/50 and multiply change what reaches the screen. Painting is clipped to the selection, as in the original: the pencil (a hard square tip of 2r+1), the brush (a round one) and the eraser all go through PaintTip, which reads the box around the dab once, mixes by the coverage and writes it back. Before that the pencil drew its tip over the whole picture whatever the mask said, and the pencil ignored its radius entirely (one XDrawPoint). -optest proves both: a tip laid across the edge of a 2 px selection changes only those two columns, and the wand at tolerance 0 takes one pixel where tolerance 100 takes six. The clipboard carries the shape of the selection, not its bounding box (2026-11-22): clipRGB plus one coverage byte per pixel instead of a pixmap, so a lasso pastes its outline and a feathered edge blends. Three faults fell out of that the same day. Copy took the rectangle, so Paste brought back the pixels the lasso had excluded. Cut cleared the whole picture -- it was MaskClear plus a full XFillRectangle, so cutting a lasso wiped everything outside it. Paste Into called PasteFromClip() with no limit and was a second Paste. -cliptest checks all three plus the soft paste against exact pixels, and the menu path through a mouse: a dragged 60x60 box gives dtphoto: copied 60x60, and after Select > None the same Copy gives copied 1024x768. MaskFromRect claims the selection itself. MaskClear drops hasSel and every caller set it before the call, so the rectangle produced a mask nothing believed in: Copy fell back to the whole picture and Clear/Fill/Crop ignored the marquee. A rectangle put into the mask is a selection; the function that puts it there says so, and no caller has to remember. dtpaint builds its menus in code and its labels are catalogued (dtpaint.msg, 51 messages from 1-53, 52 unused: menus, the tool/file/error/discard/attributes/colour/print dialogs, Help and About); the program has no render table, so its German strings avoid umlauts (a UTF-8 ü came out as two latin-1 characters under the core font, measured 2026-11-16; the German copy transliterates ae/oe/ue throughout, re-measured 2026-11-21). Its canvas is a drawing area of exactly the image size inside a scrolled window (a click outside the image must never reach XGetImage -- the picker crashed there), undo is one snapshot taken before every image-changing operation and refreshed after a load, and Open/Save/Invert convert colours through the visual's masks on TrueColor (or in batches otherwise), never one X round trip per pixel (measured 2026-11-21: open 18.3 s -> 0.02 s, invert 14.9 s -> 0.05 s, save 6.3 s -> 0.23 s on a 1024x768 BMP; PseudoColor measured 2026-11-22 on Xvfb depth 8: 4-colour BMP round trip exact, selftest PASS -- a picture with more colours than the 256-cell colormap holds loses the excess, as any 8-bit paint must). D3/D4 are built (2026-11-22): the airbrush sprays, Text fills a background box and draws the GC font, Curve is a two-phase quadratic and Polygon closes on a right or double click; rectangular and free-form selection draw an XOR marquee, move their pixels and clear through Edit > Clear Selection (Del), and Select All is Ctrl+A; the magnifier and View > Normal/Large Size zoom 1x/2x/4x/8x; Attributes resizes the document (a document operation, no undo across it); Edit Colors sets the foreground from three RGB scales; BMP 8-bit (uncompressed and RLE8) and the first image of an ICO (1/4/8/24/32 bpp, alpha 0 composited on the background; PNG-compressed icons refused) go through the program's own reader; PNG, JPEG, GIF and XPM come from McdeThumbRead (libDtSvc), so the program carries no second decoder. PSD is its own reader and writer (a layer stack cannot live in a flat pixmap): every channel plane goes through PackBits unless packing does not make it smaller, and the channel length in the layer record is measured by the same routine that then writes it, because a length guessed from w*h and two bytes put the reader at the wrong offset. The RLE layout is the one Photoshop writes: all the row lengths first, then the rows -- the first version interleaved them, and the program's own reader made the same mistake, so only a foreign decoder could catch it. ImageMagick reported InvalidLength until both sides changed; after that it reads the composite and the layer at the pixels the test wrote. Measured 2026-11-22: a 64x64 picture with one hard edge is 2436 bytes packed against about 12530 raw, and -rletest checks both the size and the pixels. -psdread reads a file ImageMagick wrote (16x12, alpha as coverage) so the reader is not only tested against the writer. Saving writes the format the name ends in, .png and .bmp through McdeThumbWrite, .psd through the layer writer, anything else as 24-bit BMP. Measured 2026-11-22 on Xvfb depth 24: a 40x30 PNG written back is 1200 of 1200 pixels identical, a GIF 0 of 1200 different, JPEG q100 at most 3 steps per channel; on depth 8 a 32-colour picture comes back exact and the 1200-colour ramp is off by the colormap (mean 28.6 of 255), which is the visual, not the reader. test_thumb writes a 13x7 ramp and reads it back pixel for pixel, and turns red when the writer's rows are flipped or its channels swapped. Print spools the current image through mcde_sys_print_file (lp; MCDE_PRINT_COMMAND fakes the tool in tests) and removes the temporary file when the job ends. McdeSys has a catalog too (lib/McdeSys/mcdesys.msg, lib/McdeSys/ text.c, mcde_sys_msg): common.c's tool errors ask it for their sentence (messages 1-9: not there, cannot start, failed with status, no pipe, no answer, out of memory, ...), so mcde_sys_error() reaches the dialog in the user's language -- a library does not call setlocale, the program does. mcdesoundd gets no catalog: what it writes is the log of a background daemon, and the system layer stays English (point 6). A new catalog must be added to programs/localized/templates/msg.C.am for C and to the PLIST (C plain, a locale with ${PLIST.nls}).

What is in it

  • The CDE 2.5.3 tree (first commit unchanged) with the fixes of pkgsrc wm/cde folded in. IMPORT says where it came from.
  • pkgsrc/ -- recipe wm/mcde (mcde-0.1.0); pkgsrc-motif/ -- recipe x11/mcde-motif (same archive, WRKSRC motif/, CONFLICTS motif, lesstif, openmotif); tools/ext-sync.sh copies them into pkgsrc.
  • motif/ -- Motif 2.3.8 with pkgsrc x11/motif's patches and MCDE's own fixes (Command key in lib/Xm/Transltns.c, exported menu bars _XmMenuBarSetExported, Xft renditions). Outside pkgsrc MCDE builds it itself (configure.ac, --with-private-motif, the default); through pkgsrc on Makronix it is the system's Motif (--without-private-motif), and the recipe/buildlink direct other Motif packages to it. Konrad, 2026-11-13: MCDE builds its own Motif when it is not Makronix.
  • lib/McdeSys (libMcdeSys; test_sysinfo), lib/McdeSound (include/Mcde/Sound.h), lib/DtSvc/DtUtil2/Mcde*.c (global menu client side, menu model, images, display arithmetic and RandR, WM hints); headers in include/Mcde/. McdeThumb.c (include/Mcde/Thumb.h, test test_thumb) is the miniature: PNG, JPEG, GIF, BMP and XPM read with libpng, libjpeg and C99, scaled with a box filter and cached in ~/.dt/thumbs/<64|128|256>/ -- the one picture reader for dtfile and the programs that show pictures, no gdk-pixbuf, no program per picture. Since 2026-11-22 it writes too: McdeThumbWrite (PNG through libpng's simplified API, BMP in C99, the ending decides), so an editor saves without a second encoder.
  • Programs of its own: dtbar (top bar and global menu, protocol include/Mcde/GlobalMenu.h), dtkeys, dtthemesync, dtappscan, dtsystemsettings (panes by category, McdeSys only), dtdiskutility, dtbackup, mcdesoundd, dtphoto, dtpaint, dttoolbox.
  • dtchat (in progress, Phase 0; scope mcde/dtchat): the Motif chat program. lib/libDtChat is the core (JSON IPC, adapters, local peer, media), programs/dtchat the UI, programs/dtchat-irc and programs/dtchat-xmpp the always-built adapters; programs/dtchat-telegram (TDLib) and programs/dtchat-whatsapp (whatsmeow) are separate packages. The IPC contract is docs/reference/dtchat-adapter-protocol.txt, the decision docs/reference/dtchat-architecture.txt. Rules: the UI and the core never link a protocol library; an adapter is a JSON-lines process under ${libexecdir}/dtchat, spawned only from there (plus --adapter-path in tests); the local peer protocol and media live in the core.
  • Changes inside CDE programs, marked "MCDE" in the source: dtfile (Navigation.c, NetView.c, Columns.c, Peek.c -- the preview on Space, with McdeThumb; Trash.c -- the question before the Trash is emptied, Menu.c -- Open Trash/Empty Trash in the File menu), dtterm (Tabs.c, Dropdown.c, Profiles.c, Xft), dtwm (WmMcdeSnap.c, WmMcdePanel.c, WmMcdeDisplays.c, WmSlideshow.c, always-on-top, _NET_ACTIVE_WINDOW, McdeExcludeBar), dtlogin (config/sessionetc.d), the front panel (programs/types/dtwm.fp.src, types/dt.dt.src).
  • programs/icons/MakronixDtlogo.pm -- the Makronix logo, default of dtlogin.
  • programs/icons/ also carries 178 .pm files of the Solaris 2.6 CDE icon package SUNWdticn that CDE 2.5.3 does not have (provenance and the rule in programs/icons/SOLARIS); existing names are not overwritten.

Conventions that bind

  • Session start: the desktop's own programs (mcdesoundd, dtlaunch, dtterm -dropdown, dtbar, login items) are started by dtsession through config/sys.sessionetc and config/sessionetc.d/ (source of the scripts: programs/dtlogin/config/0*), not by Xsession.d. Started before dtsession they took *background from the user's ~/.Xdefaults (purple bar, 2026-11-13). Xsession.d keeps only what must precede it (language, fonts, displays, dtkeys, home folders, dtappscan, dtthemesync: dist_xsess_SCRIPTS).
  • Command key (shortcuts by the place of a key): the key left of the space bar is Command = Mod4 on every keyboard, left of it Option = Alt (Mod1, Motif's mnemonics), then Ctrl. programs/dtkeys exchanges left Alt and left Windows on a PC keyboard; a Macintosh keyboard is already so (mcde_sys_keyboard_is_mac); ~/.dt/keyboard "type: auto|pc|mac". Menu shortcuts on letter keys are Mod4<Key>x showing "Cmd+X" in every catalog. Ctrl+C stays the interrupt in dtterm.
  • Program switcher (Command+Tab, f.mcde_app switcher): the bar stays as long as Command is held; dtwm grabs the keyboard while it is up and the release of a Command key closes it at once (McdeSwitcherEvent, WmMain.c looks before the generic dispatch). Repeated Tab walks on, Shift+Command+ Tab goes back; the chosen program is raised and focused on every press.
  • Global menu: every Motif program takes part through DtInitialize without its own change; MCDE_NO_GLOBAL_MENU keeps a menu bar in its window. A foreign window is registered with a hidden core widget, never a shell. A program without a global menu in front: the bar shows only the M menu. The bar uses colour set 5 (Dtbar*secondaryColorSetId: 5).
  • Testing a pane: tools/mcde-shot.sh sets DTDATABASESEARCHPATH with commas (types/%L,types/C), which is the separator DtEnvMap uses for this variable; a colon-separated list leaves DtDb half-loaded, so data types say UNKNOWN and actions ("StartDtscreenSwarm", "Trash") are not found (measured 2026-11-14 -- the screen saver preview showed "Action ... was not found" until the commas were in). The same script exports DTSCREENSAVERLIST as dtsession would and TTPATH (the install's appconfig/tttypes): ttsession starts the handler of a message (DtAction "Trash", Cmd+Delete) from the ToolTalk types, and finds them only in ~/.tt, /etc/tt or /usr/dt/appconfig/tttypes unless TTPATH names a directory (ttsession(1); lib/tt/slib/mp_typedb.C tt_path()). Without it Cmd+Delete said TT_ERR_NO_MATCH ... disposition was not queue or start and left the file (measured 2026-11-15, t0206); with it the file is in ~/.dt/Trash and the Trash Can window lists it.
  • Window titles are UTF-8 in the reference's face. The title has its own XFontSet (WmInitWs.c: Adobe Helvetica 14 bold oblique, the 4Dwm face, plus an ISO10646 fallback); DrawWindowTitle draws _NET_WM_NAME (or WM_NAME converted from compound text with _XmStringUngenerate) with Xutf8DrawString and clears the title box first. Motif's XmString path cannot draw UTF-8 under a non-UTF-8 locale -- with LC_CTYPE=C a _NET_WM_NAME of "Grüße 日本" appeared as the JIS bytes "FJK" (measured 2026-11-22). The _NET_WM_NAME atoms are interned whether or not EWMH is on, and 0010.language gives a session without a language LC_CTYPE=C.UTF-8: XCreateFontSet builds for the locale, and in C the set had only ASCII (font set test: "Grüße" 17 px instead of 43).
  • The session UI is IRIX Helvetica, not the wider CDE -dt-interface system face: programs/dtsession/sys.resources.src and sys.font.src select Adobe Helvetica 14 px on screens wider than 1175 pixels, 12 on a medium one and 10 on a small one, for *FontList, buttons, labels, text and the editor -- the CDE face read one size too big. The title and the menus stay at the 4DWm reference, 14 px bold oblique (Dtwm.defs.src, 8a0a5ac3); the panel is the same face at 14/13/10.
  • Windows: dtwm places and maximizes below the bar; the title sits at the left of the bar (Dtwm*titleLeft: True, the 4Dwm SG_titleLeft; the CDE default is centred) and the frame is 7 pixels wide, as the reference's 4DWm app-defaults say; Alt+Button2 resizes a window like Alt+Button1 moves it. The palette IRIX.dp carries the reference's greys (sgilightgray #c0c0c0, sgibrightgray #e0e0e0); focus follows the pointer without auto-raise by default; a client straight onto a desktop icon clears the keyboard focus (the icon windows select EnterWindowMask and WmMcdeDesktop calls Do_Focus_Key(NULL)); the bar is no focus target: dtbar sets _MCDE_NO_FOCUS and dtwm's focus-follows-pointer path skips such a client, so the program keeps the keyboard and its menu (t0255), so a non-client area never leaves the last terminal focused (t0255); zones and full screen use Command+Ctrl keys; the outline is XOR or four thin windows, never FlashOutline. An iconified window shows image and label (Dtwm*iconDecoration: label image, 85x67 pictures) and the icons fill a tight column at the left edge (iconPlacement: top left tight -- the first token is the primary direction; iconBoxSBDisplayPolicy: vertical keeps the icon box from overriding it), Konrad's 4Dwm look of 2026-11-15. The main display carries bar and front panel, the others the backdrop only; workspaces are shared; MCDE remembers a monitor (EDID) in ~/.dt/displays. F9/F10 open the window overview (WmMcdeOverview.c): an override-redirect window with a grid of tiles, one per window, ordered by the windows' places, each with its title; arrows/Tab/pointer choose, Return or a click raises and focuses that window and closes it, Escape closes. F10 keeps the focused program's windows (WM_CLASS), Ctrl+Up/Down do the same. F11 iconifies every window of the workspace and the next F11 brings exactly those back. A new dtwm function name is not bound by a key: the bindings name f.mcde_app overview-all|overview-app|overview-desktop, which F_McdeApp routes (measured twice). F8 opens the workspaces overview (WmMcdeSpaces.c, t0183): the workspaces in a grid (n=4: 2 x 2), each a small screen with its name and its windows as outlines at their places; the workspace you are in has a white frame, the chosen one a blue one; arrows, a digit, Return or a click go there, Escape or F8 closes. Drawn once on demand, nothing runs while it is closed. Not yet: the backdrop in the miniatures, dragging a window to another workspace, assigning programs to workspaces. Testing keys on Xvfb: xdotool key F8 (xdotool 3.20160805, this keymap) sends Alt_L first and F8 with Alt held, so no binding of F-keys without a modifier fires; use tools/mcde-xkey.sh F8 (plain XTest keycodes). That was the "F9 does nothing" of t0058/t0216; f.mcde_overview bound directly to F9 still does nothing, with the plain sender (2026-11-15), so "a new function name is not bound" stands. Keys go into the key set the session loads, Keys DtKeyBindings (message 11 of programs/localized/*/config/sys.dtwmrc.tmsg; Dtwm*keyBindings: DtKeyBindings): the Command keys (Mod4: Cmd+Tab, Cmd+H, zones, Ctrl+Left/ Right, screenshots) stood only in DefaultKeyBindings and did nothing until 2026-11-15. A default install reads no sys.dtwmrc (dtwm looks in ${CDE_CONFIGURATION_TOP}/config/%L/, and only the installation copy ${CDE_INSTALLATION_TOP}/config/%L/sys.dtwmrc exists), so a key that must work out of the box belongs in builtinKeyBindings (programs/dtwm/ WmResource.c) and in the tmsg. Ctrl+F2 (dtbar -command menu) is such a key: the bar takes the X input focus and the Motif focus goes to its M cascade (measured 2026-11-15: focus before on the Terminal window, after on the bar's 1280x22 shell). Down/Return still open no menu (t0257): dtwm's focus-follows-pointer hands the input focus back to the window under the pointer within a second, and Motif ignored both a synthetic F10 and a ButtonPress sent to the bar, and XtCallActionProc("MenuBarSelect") from the ClientMessage handler; a keyboard grab waits for the key release (150 ms timer) and succeeds, but the following key did not arrive at the bar in the measurement. A menu opens with the pointer only until a dtwm-side or event-based path is found. The front panel is not snapped or made full screen by keys. The panel defines the standard arrow on itself when it is mapped instead of inheriting one from its frame (the frame's cursor was a black 16x16 square on the MacBook, measured 2026-11-21), and the busy cursor's handle is kept: it used to be created and thrown away, so BUSY_START defined cursor None. The dock's kept programs (~/.dt/panel-apps) have a pane of their own, System Settings > Dock: it lists them, removes one, adds one from a command and restarts the window manager (_DtWmRestartNoConfirm) so the panel is built again. A double click on a window's title bar does Dtwm*mcdeTitleBarDoubleClick (none by default, minimize or maximize); the Appearance pane writes it and restarts dtwm (_DtWmRestartNoConfirm).
  • Front panel: Files, Mail, Terminal, Network, Desktop Style left of the workspace switch (Konrad, 2026-11-11); right of it the programs of the dock, the printer and the trash, in that order (Konrad, 2026-11-15). The Terminal starts xterm (PUSH_ACTION Xterm, CLIENT_NAME XTerm; Konrad does not want dtterm as the panel's terminal). The dock part is WmMcdePanel.c: kept programs left, a vertical separator, the running programs that are not in the dock right; dragging an icon out to the left keeps it (to the kept half), out to the right unkeeps it. No clock in the panel (the bar has it). Actions at the end of types/dt.dt.src take no shell variables and no CDE_INSTALLATION_TOP inside '...' (docs/reference/frontpanel.txt). An icon dragged from the dock onto a drawer's control in the main row goes into that drawer: WmMcdePanel.c writes ~/.dt/panel-drawers (SUBPANEL <tab> CLASS <tab> COMMAND), the program leaves the dock, and an icon dragged out of a drawer onto the dock is kept there and leaves the file. The stored icons join the layout at the end of SubpanelCreate (McdePanelFillDrawer), and the last one holds the form's bottom (as CDE's own last control does), so a drawer is created as high as its contents -- the earlier attempt added a widget to a realized form, where it stayed outside the drawer's height (measured 2026-11-16). An icon added while the session runs shows in the drawer after the next session: the posted drawer's shell keeps the height it had when it was created.
  • Pictures: PNG goes through McdeImageGetPixmap (libpng), because Motif 2.3.8 draws an RGB PNG as its blue channel only (docs/reference/motif-png.txt); free with McdeImageFreePixmap.
  • The mouse wheel scrolls every scrolled pane: DtInitialize installs DtUtil2/McdeWheel.c for the program, which hooks the ButtonPress/ ButtonRelease wire conversion (XESetWireToEvent) and, deferred to the event loop, moves the nearest XmScrolledWindow's or XmScrollBar's value by three increments (XmText by its topCharacter) and swallows the wheel event. Buttons 4/5 are up/down, 6/7 left/right, Shift+4/5 horizontal too. This is the layer every widget passes through, so a custom drawing area in a scrolled window scrolls like XmList; horizontal needs a horizontal scrollbar (XmText's own does not follow the bar -- Motif has no public horizontal text scroll; vertical works).
  • Keyboard and mouse: one pane, Keyboard & Mouse (three tabs; -pane keyboard|mouse|shortcuts open a tab). ~/.dt/keyboard carries type: (auto|pc|mac, dtkeys' Alt/Windows exchange) and the modifier functions (capslock: control and its three neighbours); "dtkeys auto" applies both with XChangeKeyboardMapping/XSetModifierMapping, at login (Xsession.d/0072.dtkeys) and at once from the pane. Whether the keyboard is Apple's is asked of the machine first (hw.model starting with "Mac"), then of usbdevs: at session start the internal keyboard may not be enumerated yet, and a MacBook took the PC branch and exchanged Alt and Command (_MCDE_KEYS said "pc", measured 2026-11-21). The Shortcuts tab keeps ~/.dt/shortcuts (Name=key); the launcher's key is live there: Dtlaunch*hotkey, and dtlaunch -quit asks the running launcher to let go of it, so the next one takes the new key. The other rows are a record -- their keys live in dtwm and the app-defaults. The Mouse tab: buttons and handedness, pointer speed, double-click time, the wheel's direction (the radio pair swaps buttons 4 and 5; the text names the direction the content goes when the wheel is turned towards or away from you) and, on NetBSD, the touchpad through mcde_sys_touchpad_get/set (hw.synaptics.*: tap to click, two fingers as right or middle button, a scrolling strip at the pad's edge). Those sysctls are CTLFLAG_READWRITE, so changing them needs root: the pane saves ~/.dt/touchpad (English keys tap, fingers, scroll) only when the write worked and says so when it did not; dtsystemsettings -apply-touchpad puts the saved values back (a boot script can call it as root). Linux has no such interface below X (libinput, per device): the pane says so instead of offering switches that do nothing.
  • Desktop & Screen Saver are one pane with two tabs (the old -pane screensaver opens the saver's page). The saver list is dtsession's DTSCREENSAVERLIST plus StartDtscreenRandom (dtscreen -mode random, an action of its own in programs/types/dtscreen.dt.src); "Test" starts the chosen saver in a fullscreen override-redirect window and stops it after 8 s (dtscreen has no input loop; a session's saver is ended by dtsession's lock, which the settings program does not have). "Options..." writes dtscreen.<mode>.batchcount and .delay into the server's resources and ~/.dt/screensaver. The start time has the reference's seven steps (3/5/15/30/60/120 minutes, never) and goes to dtsession as the saver timeout.
  • System Settings is one window: 1022x550, minimum equal to maximum, and every pane lives in it -- a pane taller than the window scrolls (the pages sit in an XmScrolledWindow with XmAUTOMATIC) instead of growing the window (Konrad, 2026-11-21). The tab strip is one of many (XmNradioBehavior, XmNradioAlwaysOne), so a visited tab does not stay pressed. A pane's picture must exist in appconfig/icons/C; three did not (CDs & DVDs, Energy Saver, Dock) and one was used twice (Startup and Accounts).
  • The "already exists" question (dtfile/OverWrite.c, create_replace_rename_dialog): one sentence ("An item named ... already exists in this location. Do you want to replace it with the one you are copying?"), the warning icon, and Keep Both / Stop / Replace -- no radio box, no rename field. Replace is the default (Return), Stop the cancel button and Escape; Keep Both keeps the generated new name. The old callbacks and the pipe protocol to the file operation stay: the radio toggle and the text field exist unmanaged (G_rename_toggle, G_rename_text). The default button gets the focus (XmNinitialFocus of the button row, a tab group of its own; on the form it is ignored): in a Motif dialog Return activates the button that has the focus, not the dialog's default, and until 2026-11-15 the focus sat on the first button. A folder that exists (create_replace_merge_dialog): "A folder named ... already exists in this location. Do you want to merge the contents of the two folders?" with Stop / Merge (Merge default, Escape = Stop); the radio box is gone and so is "replace the whole folder" (a collision of names inside is asked about one by one), G_merge_toggle exists unmanaged. Measured in Xvfb with the Copy Object dialog (Cmd+C): Return and Merge -> B/ord has both files, Escape and Stop -> unchanged, A/ord always whole; the single-file dialog: Return -> f.txt is the copy's, Escape and Stop -> the old one stays, Keep Both -> two files. Keep Both renames the existing file (f_1.txt keeps the old content, the copy takes f.txt): the old CDE rename-the-existing protocol; the Finder keeps the incoming copy under the new name -- not changed, the file operation would have to take a new name for the copy. The multi-collision dialog is unchanged (follow-up: "Do this for all").
  • Copy progress (t0155): the child that copies a file (FileManip.c, the read/write loop) writes PIPEMSG_PROGRESS with done/total and the target name over the existing status pipe pipe_s2m (a message per megabyte and at the end); FileOpPipeCB (FileOp.c) reads it and fills the small "Copy" window -- "Copying "NAME"", a scale the program only sets, "X MB of Y MB", Cancel -- created with the first message and popped up one second later (XtAppAddTimeOut), so a short copy shows no window. Cancel kills the child (mcdeChildPid) and unlinks the half-written target. Measured: a 4 GB copy shows the window with "129.0 MB of 4295.0 MB" while the file is written.
  • Host-qualified names in the type database (lib/DtSvc/DtUtil1/Dts.c, local_path()): dtfile and the actions hand host:/path (the netfile form) to DtDtsFileToDataType; the content criteria then opened "host:/path" and every content-typed file was UNKNOWN -- a .txt showed the "??" icon and Put in Trash refused it with "data attributes: UNKNOWN" (measured 2026-11-14: the same file is TEXTFILE under its plain path and UNKNOWN under kitt:/path; a directory is FOLDER vs UNKNOWN). When the host part is this computer's name or localhost, the lookup now uses the path without it. Measured after: TEXTFILE/FOLDER and the text, folder and picture icons in dtfile. Trash still answers TT_ERR_NO_MATCH -- that is the ToolTalk handler of t0206, not the type.
  • The web browser (t0179): the desktop has one action for a web page, McdeWeb (programs/types/datatypes.dt.src; EXEC_STRING runs dtsystemsettings -open-web "%Arg_1%"), and the choice of browser lives in ~/.dt/defaults as web: (Default Programs pane). -open-web is handled before Xt is set up -- an action must not need a display -- and starts the program with execlp, never a shell; the argument is refused when it carries a shell character. The .html and .htm criteria of programs/types/firefox.dt map their Open to McdeWeb, so a double click in dtfile follows the file's choice (measured: with web: mcdetest-browser dtfile hands the page to that program, with web: firefox a Firefox window opens). Measured too: an action whose ARG_TYPE names a data type the file does not have is refused ("Either action ... does not apply"), so McdeWeb takes ARG_TYPE * and is named only by the types that may use it.
  • Firefox's look and keys (dtthemesync, the Firefox() part): every profile under ~/.mozilla/firefox that has a prefs.js gets a user.js (browser.download.dir = ~/Downloads, browser.download.folderList 2, reduced motion, no cosmetic animations, no smooth scrolling, and ui.key.accelKey 91 -- Command is Mod4 in MCDE) and a chrome/userChrome.css written from the palette (toolbar, tabs, arrow panels). Measured: the files appear with --toolbar-bgcolor: #c6b2a8 from Default.dp. Firefox is GTK and takes no part in the desktop's global menu: dtbar shows only the M menu while it has the focus. A Firefox window's own Cmd+T/W/L was not measured (the user.js sets the accelerator; that measurement needs a person at the keyboard); the dtexplorer of the task is its own program, still to come.
  • The program menu's Hide / Show All (dtbar, AppHide/AppShowAll): Hide and Hide Others send WM_CHANGE_STATE IconicState to the clients; Show All sends NormalState to the client of every frame of the screen (XQueryTree + XmuClientWindow, because an iconified window is unmapped and ClientWindows() skips it). Measured 2026-11-14: with two dtpads minimized (both IsUnMapped) dtbar -command showall makes both IsViewable; dtwm's WM_CHANGE_STATE handler does accept NormalState (an earlier note that it ignores it was wrong -- the test then had sent the message to the wrong window). dtbar -command showall is the key-side entry, the menu item calls the same function.
  • dtcmprefs (programs/dtcmprefs): the calendar's settings window on the shared McdePrefs pattern -- General (first day of the week, week numbers, default appointment length), Accounts (a read-only note: the session's rpc.cmsd holds the appointments, a CalDAV account comes from ~/.dt/accounts.conf once the connection part exists) and Advanced (remind this many minutes before). Kept in ~/.dt/dtcm.conf. dtcm's File > Options... starts it (calendarA.c, edit_cb, fork/exec, no shell) -- measured: the binary carries the name and the window runs on its own.
  • dtimage (programs/dtimage): the picture viewer of the reference -- toolbar Previous/Next, Zoom -/+, Slideshow, the picture in a scrolled canvas, the folder's pictures on the right, the name, size and zoom in the status line. Pictures come from McdeThumb (PNG/JPEG/GIF/BMP/XPM); the module only shrinks, so dtimage scales itself (nearest neighbour) to make Zoom + enlarge too (measured: 320x240 at 100 %, 640x480 at 200 %). The slideshow's timer runs only while it is on. PDF is not read: the tree has no PDF renderer and the choice between mupdf (C) and poppler (C++) is Konrad's (docs/MCDE-PROGRAMS.md, section 6); a PDF says so.
  • dtnetutility (programs/dtnetutility): tabs Info (name and the interfaces with their addresses, McdeSys), Lookup (getaddrinfo(3) in the program -- a name to its IPv4 and IPv6 addresses, no program run, no shell) and Netstat (the open TCP sockets, /proc/net/tcp on Linux; sysctl net.inet.tcp.pcblist on NetBSD is the follow-up). Ping, traceroute, whois and a port scan need privileges or a network a test session does not have; they are named as follow-ups in the program's comment.
  • dtactivity (programs/dtactivity, t0091): the activity window. A table of the processes (PID, name, user, % CPU since the last sample, threads, real and virtual memory) that sorts by the column title you click (the header is one label of the list's fixed font, the click is mapped to a column by character width); Show (all, mine, system: uid below 1000) and a filter (name, user or pid, any case); Quit Process (asks, SIGTERM; Force Quit, SIGKILL) and Inspect (parent, user, state, memory, CPU time, command line); and under it CPU, System Memory, Disk Activity and Network with the numbers and a three-minute history graph (XFillRectangle, no animation). Everything is McdeSys: mcde_sys_processes, _cpu_times, _memory, _disk_io, _net_io, _signal -- no ps(1), no top(1). A disk that stands on another (dm-, md, NetBSD wedges dk) is not added up; the loopback is not in the Network numbers. One timer, 2 s, only while the window is mapped and not fully obscured (MapNotify/UnmapNotify, VisibilityNotify). Measured with strace -c -f -p for 15 s: 2349 system calls visible, 0 unmapped, 0 fully covered (an override-redirect window over the screen), 2365 when shown again; an idle sleep gives the same empty summary, a busy process does not. Quit/Force Quit measured against real processes in a PID namespace (unshare -rpf --mount-proc, which also keeps the host's processes out of screenshots): Cancel leaves a process alive, Quit ends it, a process that ignores SIGTERM survives Quit and dies of Force Quit. Not built yet: Show "with window", the global menu, Cmd+F and Cmd+1..5, the administrator's way for another user's process (t0079: it says "belongs to somebody else") and the dtappscan entry. Each tab says in a line what its colours are; the Disk and Network graphs scale to the highest stacked second. The NetBSD backends of the numbers were never run.
  • Device events (mcde_sys_disk_events, lib/McdeSys/events.c): a non-blocking descriptor of the kernel's uevent socket (Linux, AF_NETLINK NETLINK_KOBJECT_UEVENT group 1) for the programs that must know when a medium comes or goes -- hand it to XtAppAddInput, read there, never poll. NetBSD's drvctl(4) DRVGETEVENT is the follow-up; the call answers MCDE_SYS_ENOTSUP there. Measured: fd 3, read returns EAGAIN when no event is queued (test_sysinfo prints it).
  • dtconsole (programs/dtconsole): the log viewer -- the session's own (~/.dt/errorlog, ~/.dt/startlog) and the files under /var/log on the left, the tail of the chosen one on the right, a filter field, Reload and a line count. Values come from McdeSys (mcde_sys_logs, mcde_sys_log_tail); a log the user may not read is listed as such (boot.log (not readable), measured). A selected log is watched with mcde_sys_log_watch (inotify on Linux) and XtAppAddInput -- the view follows the file without a timer (measured: an appended line appears and the count grows while dtconsole runs). NetBSD's kqueue branch is the follow-up. A new program is wired in three places: its directory with a Makefile.am, programs/Makefile.am's SUBDIRS and configure.ac's AC_CONFIG_FILES (the build regenerates configure and config.status by itself, measured).
  • Backup pane (dtsystemsettings/backup.c): the reference's shape -- a big OFF/ON switch (its label is the state), the backup disk with "Available: X of Y" (statvfs on the disk's mount point from mcde_sys_disks), the last backup and its result, Oldest/Latest backup from mcde_sys_backup_archives, Back Up Now, Restore, the retention sentence and the keep sliders with the free-space limit. Without a configured disk the lines say so ("no disk is set up") -- measured on the build host, where backup is root work.
  • Startup Disk: not a pane any more (Konrad, 2026-11-21). The volumes from mcde_sys_disks, the one the system started from and its device are in System Information; dtsystemsettings/startupdisk.c is no longer built. Writing another startup volume's boot loader configuration (grub on Linux, boot.cfg on NetBSD) was its follow-up and stays one.
  • System Information: dtsystemsettings/sysinfo.c -- the sections Hardware, Network and Software in a list on the left, the values on the right from McdeSys (mcde_sys_info: model, processor, memory, startup disk, system, kernel; mcde_sys_interfaces and the host name). "Refresh" reads again; nothing runs a program for a value.
  • Default programs: dtsystemsettings/defaults.c -- web browser, mail, images, video and text, each a menu of the programs that are on this computer ($PATH; "(none on this computer)" otherwise), and how a link from another program arrives (a new window or a tab). Kept in ~/.dt/defaults as "key: value" (web, mail, image, video, text, web-open: window|tab); the actions of programs/types read it. The default-program file is the one the mailto:/web follow-ups use too.
  • Internet accounts: dtsystemsettings/internet.c -- the user's own services (CalDAV, CardDAV, IMAP, Files) in ~/.dt/accounts.conf (count=N, N.name, N.service, N.server, N.user); "Add..." opens a sheet with name, service, server and user, "Remove" takes one away. The programs that use an account (dtcalendar, dtcontacts, dtmail) read it there; the account never goes into a command line or a shell. No store and no third-party address book.
  • Energy Saver: dtsystemsettings/energy.c -- computer sleep, display sleep and the hard disks, each a menu (Never, 1, 5, 10, 15, 30, 60 minutes). Display sleep is dtsession's saver time (_DtSetSmState, SM_STATE_SAVERTIMEOUT) -- the same setting as the Desktop & Screen Saver page; computer and disk sleep are kept in ~/.dt/energy.conf and need the operating system (root; NetBSD: the powerd/atactl part, follow-up task). A schedule and the DPMS timeouts are the same follow-up: Xvfb has no DPMS extension (measured with xset). Pass a gadget (a menu item) to XtDisplayOfObject, not XtDisplay: XtDisplay on a gadget segfaults (measured in this pane).
  • CDs & DVDs: dtsystemsettings/cds.c -- five lines (blank CD, blank DVD, music CD, picture CD, video DVD), each with a menu "Ask what to do", "Ignore" or "Open "; the values ask, ignore, action:NAME are kept in ~/.dt/media.conf (English keys: blank-cd, blank-dvd, audio-cd, picture-cd, video-dvd), the file the medium-insert path of t0083 reads. No "run a script" entry: a file name never goes into a shell.
  • Parental Controls: dtsystemsettings/parental.c edits ~/.dt/parental.conf (LOGIN.only, LOGIN.allow, LOGIN.day, LOGIN.weekend); the launcher enforces it, because dtlaunch is where a program is started: the program list shows only the allowed names, a start outside the hours or of a disallowed program is refused with a sentence in the window, and every start is appended to ~/.dt/parental.log (the Log tab reads it). A state given to a toggle or radio before its page is laid out does not paint in this pane (measured); the list's selection does. System-wide enforcement (execute permission outside the list, ending a session when the hours are over in dtsession, and the child's own file under root) is the follow-up -- the desktop's part is the launcher.
  • The desktop: WmMcdeDesktop.c draws the icons of the desktop in the style of IRIX 4Dwm (4DWm app-defaults: iconDecoration "label image", iconClick false, iconPlacementMargin 10), in the top right corner and filled from the top down, then the next column to the left. The pictures are the Foundation icons at 64x64 (programs/icons/Irix*.m.pm, rastered by tools/fti2xpm.py from the .fti sources; the size is its third argument), and a medium picks its own by file system: cd9660 the CD, udf the DVD, msdos the diskette, tar/dump the tape, anything else the disk. A window's label is drawn on the backdrop with a shadow, not into a tile: the icon window is shaped (XShapeCombineMask) to the picture and the text. The icons are mapped and lowered -- an override-redirect window is not restacked by the window manager, so XMapRaised used to put them above every client; now a raised window, a full screen one included, covers them, as 4Dwm's desktop does. The order is the computer itself ("/", the only system volume that is shown), the disk mounts, the removable media (a stick, a CD or a DVD -- also when it is not mounted), the network mounts (NFS, SMB, AFP, sshfs) and the person's files and folders from ~/.dt/Desktop and ~/Desktop. Each icon has a window of its own (override-redirect), an XPM glyph from programs/icons and a one-line label cut with "..." when it is too long. A double click opens the place with dtfile; a medium that is not mounted is mounted first (mcde_sys_disk_mount). A right click opens a menu of its own -- Open, Open Home (the computer), Show on All Workspaces, Show on This Workspace Only, Unmount, Move to Trash (a user icon). The icon can be dragged; its place and its workspace are kept in ~/.dt/desktop.conf and a stick or a disk that comes back appears where it was left (the places are never forgotten). McdeDesktopWorkspaceChanged() (WmWrkspace.c) maps the icons of the workspace; all icons are on all workspaces until the menu says otherwise. A volume plugged in later shows through the kernel's device events (mcde_sys_disk_events, 500 ms gathered); NetBSD has no drvctl branch yet (t0272), there a slow timer and a workspace change rebuild the list. A device removed while a partition of it was still mounted gets the reference's one-button "Disk Not Ejected" warning (Motif error dialog, the Warning sound; mcde_sys_disk_detached copies the stale mountpoint and unmounts it the forced way, lazy on Linux, -f on NetBSD). MCDE_DESK_DEBUG=1 prints what it found (the shot harness passes the variable, and MCDE_DESK_TEST_MOUNTS/_DISKS/_DESKTOP fill a test list without real mounts; MCDE_DESK_TEST_DEVICE hands the desktop one event line, the path a test or a screenshot takes without a kernel). McdeSys had no list of network mounts before: mcde_sys_mounts() (mount.c, /proc/mounts on Linux, getmntinfo on NetBSD) names every mount and marks the network file systems; the desktop takes the local volumes from mcde_sys_disks (labels) and the network ones from there.
  • The bar is no focus target (_MCDE_NO_FOCUS): moving the pointer from a program to the bar used to take the keyboard away from that program -- dtbar set the input focus to PointerRoot on EnterNotify and dtwm cleared the active client -- so the bar showed the M menu and a click could not act on the program (t0255, t0257). dtbar sets _MCDE_NO_FOCUS on its window and leaves the focus alone; dtwm's focus-follows-pointer path skips such a client, so the program keeps the keyboard, its menu stays in the bar, and an item acts on the client the menu came from (the ClientMessage goes to that window, not to whoever has the X focus).
  • The bar's right end: a person cascade (McdeUser) whose first line is the login name from the passwd entry -- a session started with an empty environment has no USER (measured: the menu said "user") -- then Accounts and Log Out; and a magnifier cascade (McdeSearch) with "Launcher (Command+space)" (dtlaunch -show) and the settings. Both must be cascades: the status area is a homogeneous menu bar and refuses any other child ("Attempt to add wrong child type", measured).
  • The launcher finds settings (t0185, first part): dtsystemsettings -list-panes prints the panes (ID<TAB>name<TAB>category<TAB>keywords, a pane that is only named, PANE_LATER, left out; no display needed, measured 24 lines with DISPLAY unset), dtlaunch asks for them once, by pipe and exec (SIGCHLD is ignored there, so no waitpid -- it would wait for every program the launcher ever started; a 3 s poll limit stops a stuck child), and model.c (mx_panes_parse, mx_pane_match, test_panes) turns the text into results: the name at full score, a keyword at half, the ID checked (letters, digits, - and _) because it ends up in dtsystemsettings -pane ID, started with the same Parental Controls as a program. A result reads [settings] Displays (Hardware). dtlaunch -text STRING fills the field of the first opening (tests, tools/mcde-shot.sh). Measured: typing disp lists the pane second (docs/screenshots/leopard/Spotlight-mcde.png); Return on displays starts dtsystemsettings -pane displays and its window "Displays" appears. The clipboard history is told, it does not ask (t0080): XFixesSelectSelectionInput on CLIPBOARD (XFixesSetSelectionOwnerNotifyMask), the new owner is read once when the event arrives. configure.ac checks libXfixes and gives only dtlaunch XFIXESLIB and XFIXES_CPPFLAGS (-DHAVE_XFIXES) -- not a define in config.h, which would recompile the whole tree. Without the library or the extension the owner is asked every 5 s (POLL_MS). Measured with strace (writes to the X socket, 10 s idle after a 4 s start): 10 with the 1 s poll, 0 with XFixes, 2 (at 5.0 s and 10.0 s) in the fallback (the fallback tested with an LD_PRELOAD shim that makes XFixesQueryExtension fail: an Xvfb started with -extension XFIXES aborts as soon as any Motif client connects, privates.h: dixGetPrivateAddr: Assertion key->initialized, also for an unmodified dtpad, so it cannot serve for this). Both paths still catch a copy (xclip while the launcher idles, then dtlaunch -show: the history shows it). The history is opt-in (Dtlaunch*clipboardHistory, default False; System Settings > Keyboard & Mouse > Shortcuts writes it and restarts the launcher): off, nothing is asked of the clipboard's owner (0 requests measured) and the hint line drops "the clipboard". On, a new text is kept only if its owner does not offer x-kde-passwordManagerHint as "secret" (docs/reference/clipboard-password-hint.txt). The recipe has x11/libXfixes/buildlink3.mk for it -- not yet through a real cross build. Not done yet: the two-column list grouped by category, documents/mail/PDF/web results, and the magnifier button in dtbar with -at X,Y.
  • dttoolbox is told, it does not poll (t0080): the menu the desktop publishes (_SGI_MENU_Selected on the window that the root property _SGI__MENU_WINDOW names) was read every 500 ms with two atom lookups and two property reads; now main looks at PropertyNotify itself (Xt routes no event for a foreign window to a widget -- dtlaunch's loop does the same) and asks for the menu window's property events before it reads the text. Idle writes to the X socket in 10 s (strace): 20 before, 0 after. A change shows at once (0.01 s after start, 3.001 s and 7.001 s for the changes made at those times; the poll needed up to 500 ms). A rebuild while the menu is open is deferred; the text is then forgotten and one timer (1 s) retries, only while that waits -- the old code recorded the text as seen and never built it. A crash that was there before: the third change of a menu with children died in XtDestroyWidget (SIGSEGV, measured) because the loop walked the parent's own XmNchildren array while each destroy shortened it; the list is copied first now. Not exercised: the deferred-rebuild path (it needs an open menu).
  • The process list (mcde_sys_processes, t0091 first part; dtactivity is not written yet): pid, parent, owner (name or number), command name, state (R S D T Z I ?), threads, real and virtual memory in bytes, CPU time in ms. NetBSD: sysctl KERN_PROC2 asked as libkvm's kvm_getproc2 asks (size first, then the buffer by count, ENOMEM -> again), the CPU time from p_rtime_* as ps(1) does, the state from p_realstat and the LWP's p_stat -- compiled against the NetBSD sysroot with the cross compiler (x86_64--netbsd-gcc -Wall -Wextra, all of netbsd.c, exit 0), never run on NetBSD. Linux: /proc/PID/stat, read after the LAST ) (a name may hold spaces and brackets; test_processes starts a child named a b)c), memory from statm. stat's own rss is not used: on kernel 7.1 it is larger than VmRSS/statm (126 of 632 processes more than 10 % off; the same numbers ps shows come from statm). Measured against ps -eo for every process in both lists: 631 compared, parent, owner, threads, RSS, state and CPU time all agree (a vsz differs for a process that grew between the two reads). test_processes checks this process, init, a zombie until it is waited for, a sleeping child, SIGSTOP showing as T and SIGCONT back.
  • Printers: dtsystemsettings/printers.c lists the CUPS queues (mcde_sys_printers: lpstat -p/-d, parsed), shows the chosen one (state, location, model, default, shared), and adds one from what mDNS finds (mcde_sys_printers_discovered: avahi-browse -rtp _ipp._tcp, names unescaped -- avahi writes \032 as DECIMAL) with the driverless model (lpadmin -p NAME -E -v URI -m everywhere). Adding, removing and setting the default run in the terminal of su(1) (dtsystemsettings -add-printer NAME URI, -remove-printer, -set-default-printer), as the other root actions do; as a user McdeSys answers MCDE_SYS_EPERM. The queues of CDE itself stay reachable with dtprintinfo -all ("Print Queue... in the pane). Test page printing, the fax/Bluetooth/AppleTalk printers of the reference, and the NetBSD CUPS path are follow-ups.
  • libcups, measured 2026-11-14: the task for t0143 asked for libcups instead of command lines, but on the build host cupsGetDests2() returns 0x2 and leaves num_dests untouched -- through dlopen and linked directly -- while _cupsGetDests() answers no queues and lpstat -p lists the two the desktop has. So McdeSys calls lpstat(1)/lpadmin(8) with fixed arguments (the output is parsed, never executed) until a host with a working libcups and its headers builds the library path.
  • Security: dtsystemsettings/security.c, three tabs. "Require password to wake ..." is dtsession's lock time (_DtSetSmState with SM_STATE_LOCKTIMEOUT, the same field the Screen Saver page shows); with the lock at the saver's time dtsession locks the screen when the saver starts. Automatic login and a log-out after inactivity are shown as what the desktop can do today (dtlogin always asks; dtsession has no idle logout). Swap encryption, cgd volumes and the npf state come from McdeSys (mcde_sys_swap_encrypt_get/_set, mcde_sys_cgd_volumes, mcde_sys_firewall_get); the NetBSD backend is netbsd.c, on another system the functions say so (MCDE_SYS_ENOTSUP) and the pane shows it. Writing npf rules and changing a cgd passphrase are follow-ups.
  • Motif row columns in a pane: a xmRowColumnWidgetClass created inside the pane area (a vertical row column) takes the other orientation unless XmNorientation is given; with XmPACK_TIGHT a child added later 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 Security pane therefore builds its page fresh on a tab change inside a XmPACK_COLUMN container (measured 2026-11-14, several dead ends).
  • Sound: the pane is dtsystemsettings/sound.c, three tabs (Sound Effects, Output, Input). The effects are the events of the session's theme (McdeSoundEventName, a click sends McdeSoundEvent), the theme is a menu of the directories next to the current one. Three themes are in share/sounds/themes/: Camouflage (the reference's event names, MCDE's own short tones), Base (the lower voice) and IRIX (the old IRIX 6.5 sounds from ~/tmp/irix_extract/assets/desktop-sounds/sounds-events, 20 events). MCDE_SOUND_THEME=... chooses one without a session (tests; mcdesoundd -selftest checks the events and files). The session's own two tones: the daemon plays Start once it owns the selection (dtsession starts it at login) and End in the X I/O error handler -- at logout dtlogin resets the server and the player it forks outlives the daemon (t0043). Output has the volume, Mute and "Show the volume in the bar" (~/.dt/bar, showvolume=, read by dtbar at start -- unmanaged, the speaker is gone). Input is a note: McdeSys has no capture API and no sound-device list yet.
  • Program settings window (lib/DtWidget/McdePrefs.c, include/Dt/ McdePrefs.h): the reference's shape for every program -- a row of icon tabs (appconfig/icons/C, the active one pressed), the page under them, no OK/Cancel; a change goes to the program at once and is kept in ~/.dt/<prog>.conf (KEY=VALUE, the last tab as lasttab=; the store without X is McdePrefsConf.c, tested by test_prefs). The page is a vertical XmPACK_COLUMN row column of rows; McdePrefsRowBegin(form, label) returns the row, the caller builds its widget with the row as parent and calls McdePrefsRowEnd(row, child) (a widget cannot be reparented, so a row cannot take a widget made elsewhere). The window takes the size of the page on a tab change (the children are measured, not the page's request: measured 2026-11-14) and its title is the page's name. dtpad was the first user, dtmail the second (Options/dtmail -prefs: General and Viewing). Tab clicks find their window by walking up the widget chain to a shell whose XmNuserData is a Prefs -- an XtParent(XtParent(w)) lookup is not enough (measured: the tabs did nothing).
  • dtmail's settings: dtmail/McdeMailPrefs.C, opened by dtmail -prefs (the argument is taken out before Xt sees it; RoamApp::initialize returns after building the window, so no mailbox and no ToolTalk are needed). It writes ~/.dt/dtmail.conf: mailreader (the label, e.g. Thunderbird), checkinterval, newmailsound (an event of the theme, played on the click), othersounds, frontpanelcount, downloads, removedownloads, searchtrash, searchjunk, headers, sort, preview. The CDE Options dialog (OptCmd.C) stays for the retrieval details; wiring these keys into dtmail's own option system, the rest of the reference's pages (Accounts, Signatures, Rules) and the ~/.dt/defaults file for a mailto: reader are follow-ups.
  • Strip view (dtfile/Strip.c, Command+4): the reference's Cover Flow without compositing -- the chosen picture large in the middle, three neighbours flat each side (the type's picture when a file is no picture), the name and kind under it, and the folder's list below in the same form. Pictures come from McdeThumb (the ~/.dt/thumbs cache; only the visible entries are asked for), the arrows walk the strip and the list follows, Space is the preview. Command+5 is the small-icon view now. The old "Small" key moved; docs/reference/shortcuts.txt says so.
  • Network in the column view: ~/Network lists the hosts DNS-SD finds (mcde_sys_net_browse) instead of files; a host is a column of its NFS exports and SMB shares (mcde_sys_net_shares), and a share chosen is mounted on ~/Network/HOST/NAME and opened. The mount needs root; as a user it says why in a message. The sidebar's eject buttons and a "Computer > Network" root are not built. Every mount from dtfile goes through _McdeNetMount (NetView.c): a McdeSys job (mcde_sys_net_mount_start; the answer comes through a pipe, because dtfile ignores SIGCHLD), a modal "Connecting ..." dialog with Cancel, and the resource Dtfile*connectTimeout (20 s); a dead server no longer freezes the window (tasksd t0080, measured: the tool and the dialog are gone after the time-out and after Cancel). A mount in an Xt callback is never mcde_sys_net_mount. A password goes through the tool's standard input, never argv (it shows in ps(1)): sshfs gets -o password_stdin; for AFP the address says afp://user:-@host/vol and mount_afp asks getpass(3) (afpfs-ng fuse/client.c, password "-"), which reads the standard input when there is no controlling terminal (NetBSD getpass.c:106-112) -- the job runner is a session of its own (setsid), also when the caller has a terminal. Measured with a fake mount_afp: ps during a mount showed afp://alice:TopSecret-42@nas.local/Volume before, afp://alice:-@... after; under a pty the old code kept the terminal, the new one has none; a password with :, @ and / works (it was refused). mcde_sys_net_mount is _start plus waiting, so it detaches the same way.
  • Disk Utility: the toolbar carries Mount, Unmount, Eject, Verify, Info, Log, Refresh and Unlock; the detail block under the list shows device, mount point, format, capacity, available and used from mcde_sys_disks. "Eject" unmounts (McdeSys has no eject ioctl yet), and the RAID and Restore tabs say what is not built (RAIDframe/ccd, dump/dd copies); "Show details" opens and closes the First Aid report.
  • Displays menu: the bar's status area has one; it lists the monitors from McdeDispLoad and the modes of the first (the current one marked), "Detect Displays" re-reads RandR and runs dtsystemsettings -apply-displays, and "Displays Preferences..." opens the pane. A mode chosen is applied and asked about for 15 seconds, then put back (displays.c does the same). It reads only when the menu opens: no RandR timer.
  • Look settings: System Settings > Appearance writes what the session reads -- *<screen>*ColorPalette and *highlightColor/*selectColor (through _DtAddToResource, so programs started later use them), ~/.dt/recent.conf (applications|documents|servers=N, read by dtbar's Recent Items and Connect to Server), and for font smoothing fontconfig's ~/.config/fontconfig/conf.d/60-mcde-antialias.conf (an antialias=false rule; Xft ignores the Xft.antialias X resource here -- measured 2026-11-14, so the file is what reaches every toolkit).
  • Root actions (accounts, network, sharing, time zone, update) run in a terminal after su, via dtsystemsettings -<action>; backup is the exception: dtbackup run from root's crontab, passphrase in /etc/mcde-backup.pass (0600).
  • Reference documents for the system layer: docs/reference/ (borg, netconfig, wifi, sharing, battery, desktop-entry, cde-colorsets, frontpanel, motif-png).

Hazards -- never on the development host or the test VM

  • Power items of dtbar (Restart, Shut Down) tested to the end; the system may let the user do it.
  • Network Apply or Wi-Fi join over the ssh card; switching SSH in the VM (ssh is the way in); any join of Wi-Fi on the development host.
  • Erase, mount or repair in dtdiskutility.
  • Sound tests against the real PulseAudio: use a private one (null sink, own socket).
  • Xvfb loses its keymap and properties when its last client leaves: keep one (xprop -root -spy). XTest drags need -xrm "Dtwm*freezeOnConfig: False".

Building it

Building is cross and native, never in a VM (since 2026-11-13); the VM only tests installs.

  • The recipe is ext/src/mcde/pkgsrc (and pkgsrc-motif); the archive and distinfo come from tools/mcde-dist.sh (git archive of a commit, so after a change: commit, then tools/mcde-dist.sh, then build). The set is made by make userland (root AGENTS.md).
  • On the Linux host, for development: make mcde-linux (tools/mcde-linux.sh; MCDE_DIRS=programs/dtfile for one directory, MCDE_DIRS=install into build/mcde-root/dt), and make mcde-host (tools/mcde-host.sh, the desktop in /usr/mdt).
  • Every file MCDE installs is a line in pkgsrc/PLIST, in the same change that adds the file (a program, an icon, a header, a config file): pkgsrc's check stops make userland at the first one that is missing, after hours of build (14.11.: McdeLock.pm, Thumb.h, 0010.language, DtScrn.t.pm, build/logs/userland-2026-11-14n.log:26326). The line is sorted as LC_ALL=C sort sorts; the files of an option go with ${PLIST.docs} or ${PLIST.appbuilder}. Check before you commit: make mcde-linux MCDE_DIRS=plist (tools/mcde-plist-check.sh) installs the native build into a temporary directory and names every file under dt/ that no PLIST lists, in seconds -- after make mcde-linux MCDE_DIRS=install. Measured against the history: with the PLIST from before fe8abbd1bb it names exactly the six files that commit added. It excludes, with the reasons in its header, the documentation (-docs), the files the recipe moves to share/doc, and reads the Motif PLIST as if it were under dt/. A file that should not be installed at all is a bug of its Makefile.am, not a PLIST line; tools/mcde-plist.sh LOG adds what a failed build reported.
  • The C dialect is set by configure.ac (-std=gnu11 and five GCC 14 downgrades; MCDE_DIALECT_CFLAGS for a build that ignores CFLAGS); no build system needs to know it.
  • Tests: make check (test_sysinfo, test_menumodel, test_displays, test_items, test_panes, test_profiles). A test program is check_PROGRAMS; one that tools/mcde-tests.sh runs from the native build is noinst_PROGRAMS only if !MCDE_CROSS (configure.ac): in the cross build for the package it is a target binary nothing runs, and tools/check-buildtools.sh stops make userland on it (2026-11-17).

What may be changed, and how

  • Anything; it is ours. Keep the licence headers (LGPL, COPYING): the "CDE - Common Desktop Environment" lines are attribution, not branding.
  • Branding is what a user sees: names in dialogs, DtVERSION_STRING ("MCDE x.y.z (CDE 2.5.3)"), logos. DtVERSION, DtREVISION, DtUPDATE_LEVEL stay at 2.5.3: they are the API level programs test against.
  • Not yet: the install prefix (${PREFIX}/dt) and the tarname cde (from it come share/cde and etc/cde); they move together with the PLIST.
  • An update of the CDE upstream is a merge, IMPORT renewed (ext/AGENTS.md).

What must not be touched

  • The first commit (upstream archive unchanged); the API level above.
  • The rules above: an #ifdef per OS in a program, a GTK/Qt dependency, or a direct call of a system tool outside lib/McdeSys is a finding, not a patch.
  • pkgsrc itself: a recipe problem is fixed in ext/src/mcde/pkgsrc, not in the root pkgsrc/.