Commit Graph
897 Commits
Author SHA1 Message Date
lotherkandClaude Sonnet 5.5 08f37a293b MCDE: dtphoto, dtbar, dtsystemsettings, dtwm, icons and thumbnails; recipes follow the host-flag settings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 22:01:24 +00:00
lotherk 6d39469c4f mcde: ignore the build outputs of an in-tree build 2026-11-22 22:01:17 +00:00
lotherk 07207f25bc ext: splinter, junction, wikid, skilld, memoryd, tasksd as git submodules 2026-11-22 22:01:16 +00:00
lotherk c8cc69aac5 tools: dtlogin-check.sh, the installed package through dtlogin
The dev tree has mcde-desktop.sh; the .deb path (/usr/mdt, /etc/mdt) had
no test that logs in.  This one starts dtlogin on :94 against the
installed package, logs in with pam_permit, and requires the front
panel's Applications menu in the window tree.

Three things it learned in the runs, each a real failure first:

- -ac on the Xvfb line: dtlogin starts the server as nobody and nothing
  can look at it otherwise (xwininfo, xdotool, import all refused).
- Roll dtlogin.log before the run: a previous run's "Greeter started"
  satisfied the wait loop and the test measured a display that never
  came up.
- Kill the display's dtlogin and its Xvfb BEFORE restoring $HOME/.dt:
  dtsession writes sessions/current and errorlog on its way out, and a
  copy put back while it still ran was written over again.

Also: dtsession restores the last session, so without an empty $HOME/.dt
the screenshot showed the user's own Firefox and xterm, not the package
(a 682k-pixel white block).  $HOME/.dt is backed up and restored, and
the session's copy is kept in build/dtlogin-check/home.dt.session.

Test: sh tools/dtlogin-check.sh -> rc=0, clients dtwm, dtlaunch,
dtterm, mcdesoundd; screenshot is the MCDE desktop (no Firefox);
diff of $HOME/.dt against the pre-run copy: IDENTISCH.
2026-11-22 18:32:01 +00:00
lotherk 93aa5bacf2 MCDE: make debian / debian-install -- the desktop as one Debian package
Konrad, 2026-11-22: "i want mcde to support 'make debian' and it'll fully
create and download all required build dependencies and shit and make debian
debian-install would make the deb and all and then even install" and
"inkluding our own motif stuff xyz".

tools/mcde-debian.sh does the three steps in one lock:

  build    installs the build dependencies through apt-get (the ones
           configure.ac stops on and each -dev the tree compiles against),
           builds MCDE from a copy of ext/src/mcde with the path step of
           tools/mcde-host.sh, installs into build/mcde-debian-stage, strips,
           and packs build/mcde-debian/mcde_<version>_<arch>.deb
  install  installs that package
  clean    removes both directories

The package carries its own Motif: libXm, libMrm, libUil, the uil compiler
and the headers live in /usr/mdt, so the desktop runs from its own toolkit
and never from the system's libxm4 (--with-private-motif, as Konrad asked).

Four things cost a run each and are written where they bit:

- dpkg-shlibdeps matches a shlibs line on the SONAME version (libXm.so.4 ->
  4), not on the file version (4.0.4).  With 4.0.4 it ignored the line, found
  the system's libxm4 and put it in Depends.
- -L is the override file dpkg-shlibdeps READS; -T is where it writes the
  substvars it produced.  The first version passed -T and got nothing.
- -x$PKG, or the package depends on itself (every binary links /usr/mdt/lib).
- The version carries the commit, so a rebuild leaves a second .deb beside
  the first and `dpkg -i *.deb' installs both -- the older wins.  One package,
  one file: the old one goes.

debian-mcde/ holds what the package manager cannot do for the desktop: the
control paragraph, a postinst that indexes the fonts MCDE carries under
/usr/mdt/fonts for the X server, and the session entry (Type=XSession,
/usr/share/xsessions/mcde.desktop) -- without it a display manager lists the
host's desktops and not MCDE.

Verified on this host (2026-11-22):
  bmake debian from an empty build/mcde-debian exit=0,
    build/mcde-debian/mcde_0.1.0+git420f66c19e_amd64.deb (42M, 180280 KiB
    installed, 4583 files)
  Depends is free of libxm4/libuil4/libmrm4 and free of mcde itself
  the package carries usr/mdt/lib/libXm.so.4.0.4, libMrm, libUil and the
    uil compiler; /etc/pam.d/dtlogin and dtsession are conffiles
  dpkg -i installs it, postinst runs
  ldd /usr/mdt/bin/dtwm -> /usr/mdt/lib/libXm.so.4 (its own)
  on a private Xvfb: dtsession, dtwm, dtlaunch, dtpad, dtfile and the
    front panel (Applications/Files/Desktop/System/Network) run, no errors
  bmake debian-install exit=0, "mcde 0.1.0+git420f66c19e install ok
    installed", 0 upgraded / 0 newly installed

AGENTS.md and docs/BUILD-CONTRACT.md list mcde-debian.sh among the tools that
need the build lock, next to mcde-host.sh.

t0768
2026-11-22 17:35:17 +00:00
lotherk 420f66c19e docs: dtphoto PSD reader and writer recorded
The PSD paragraphs still said TIFF and PSD were open and that saving
wrote anything unknown as BMP.  PSD has been read and written for a while
now, so the two places that said otherwise are corrected.

The RLE layout is the part worth remembering: Photoshop writes all the row
lengths first, then the rows.  The first version interleaved them and the
program's own reader interleaved them the same way, so the round trip was
green while the file was wrong.  ImageMagick said InvalidLength; after both
sides changed it reads the composite and the layer at the pixels the test
wrote.

Measured 2026-11-22: 13 headless tests x 2 depths (24 and 8) green, a 64x64
picture with one hard edge 2436 bytes packed against 12530 raw, and
`-psdread` reads a 16x12 file ImageMagick wrote.

Tested: menutest optest selmodtest retouchtest movetest croptest typetest
cliptest viewtest drawtest layertest psdtest rletest on :91 (depth 24) and
:98 (depth 8) -- 26 of 26 PASS.
2026-11-22 17:23:49 +00:00
lotherk eb35bf6aac MCDE dtphoto: the clipboard carries the selection's shape, and Cut
stays inside it

Three faults in Edit, all measured against pixels:

- Copy took the bounding rectangle of the selection, so Paste brought
  back what a lasso had excluded.  The clipboard is now RGB plus one
  coverage byte per pixel (PasteBlend/SelectFromCover), not a pixmap,
  which also blends a feathered edge and keeps both depths identical.
- Cut was MaskClear plus a full XFillRectangle: cutting a lasso wiped
  the whole picture.  It is now Copy followed by PaintMask, which is
  mask-aware.
- Paste Into called PasteFromClip() with no limit and was a second
  Paste; it now clips to the selection's coverage.

And one fault at the root: MaskFromRect() called MaskClear(), which
drops hasSel, after every caller had set hasSel = 1 -- so the marquee
produced a mask nothing believed in.  Copy fell back to the whole
picture, Clear/Fill/Crop ignored the rectangle.  MaskFromRect claims
the selection itself now, and no caller has to remember.

Evidence:
  -cliptest  PASS on depth 24 and depth 8: lasso hole kept through
             Copy/Paste, cut-left/cut-right outside the band intact,
             paste-into limited to the selection, soft paste blends,
             a whole-picture clip stays opaque.
  full run   24 green, 0 red (12 modes x 2 depths)
  mouse      dragged 60x60 box -> "dtphoto: copied 60x60";
             Select > None, same Copy -> "dtphoto: copied 1024x768";
             Edit > Cut -> "copied 60x60" then "cut";
             Edit > Paste Into -> "pasted 60x60 into the selection"
2026-11-22 16:22:34 +00:00
lotherk 02aa4ce6d4 MCDE dtphoto: the layer stack is real -- coverage, a palette, options
A new layer used to be a white sheet that hid the picture: layers carried
RGB only, so nothing could say "this pixel is empty".  LayerAbsorb made it
worse by copying the whole composite into the active layer, so the layer
below appeared twice.

- Layer carries coverage (0..255 per pixel) beside RGB; the background has
  none (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.
- LayerAbsorb takes only the covered pixels of a layer that has coverage;
  the background still takes the whole picture.
- The Layers palette is a list, not a label: one row per layer, top of the
  stack first, an eye to hide it, the name to make it active.  Rows are
  rebuilt where the stack changes (new/duplicate/delete/merge), never from
  inside a row's own callback.
- Layer Options sets opacity and blend mode through FieldDialog, and does
  not absorb first: a property is not new pixels, and reading the composite
  back baked the old blend in (50% gave 127,0,0; multiply over white went
  black).
- New -layertest drives the real CanvasInput -- stack first, then the
  stroke, the order that matters, because LayerEnsure after the stroke
  would read the pixmap back and hide the fault.

Verified: 26/26 green (13 modes on depth 24 and depth 8), 206 menu paths
bound, 0 unbound, 0 doubled; build without warnings.
2026-11-22 15:54:56 +00:00
lotherk f7716b640d MCDE dtphoto: every menu entry does something, and the test proves it
-menutest read only the command table against itself, so a menu line with
no command stayed invisible: it could be green while an entry did nothing.
It now reads dtphoto.menu and counts what resolves to no command -- 206
items, 0 unbound.  Counter-check: Select/Grow set to CMD_NONE makes it
print "1 unbound" and FAIL.

Four entries only refused before and now work: Window > Show Commands
opens a palette listing the command table itself (206 rows, measured
206x26 px of text in the widget, so it cannot drift from the menu),
Publisher Options sets the EPS resolution (72 and 288 dpi, the
%%BoundingBox scales with it), Adjustment Options the default for new
adjustment layers, and Show Channels/Show Paths show measurements from the
picture and the lasso path.  File > Acquire still refuses: there is no
scan source, and saying so beats a button that does nothing.

Real bug found on the way: Layer > Type > Horizontal/Vertical switched to
tool 7, which is crop; type is slot 8.

Measured on both depths (TrueColor :91, PseudoColor :98): 14 tests x 2 =
28 green, 0 red -- filtertest optest drawtest seltest movetest croftest
croptest typetest retouchtest selecttest selmodtest menutest exporttest
placetest printtest (the last with MCDE_PRINT_COMMAND=/tmp/dtpbin/lp,
230454 bytes spooled).
2026-11-22 15:26:45 +00:00
lotherk 3e3817a83d MCDE dtphoto: the colour-model and layer entries under test, affine centre fixed
-filtertest now also covers the six entry points that sat outside every
test: CMYK Preview (must not flatten the picture to one colour), Gamut
Warning (saturated ink -> warning grey 128, printable pixel untouched),
the 5x5 Custom identity kernel, Perspective (0% identity, 50% reads the
top-left from inside the picture), a 90 degree Affine rotation as a
permutation, and Drop Shadow leaving the picture's own pixels alone.

That permutation check found a real bug: OpAffine mapped around w/2
instead of (w-1)/2, so a 90 degree turn of a 24-wide picture lost a whole
row to the background -- 552 of 576 pixels hit.  Every sampler that maps
by inverse mapping now uses the same centre.

Measured: 12 test modes x depth 24 and depth 8 = 24/24 green, build with
0 warnings (make dtphoto, forced rebuild).  The three false expectations
I wrote first were my arithmetic, not the code: gamut marks by ink above
0.9 (250,30,30 is 0.88), perspective squeezes towards the top so the
corner reads from inside, and (9,4) is 2 px from the edge.
2026-11-22 13:59:18 +00:00
lotherk c6974849ae MCDE dtphoto: the other 43 filters proven, no build warnings
-filtertest hands a structured 24x24 picture to every remaining filter
-- the four blurs, unsharp, high pass, find edges, emboss, trace contour,
facet, fragment, median, offset, clouds, crystallize, pointillize, color
halftone, mezzotint, diffuse, extrude, tiles, wind, deinterlace, NTSC
colors, dust and scratches, the nine distortions and the Image mode
family -- and checks a property of the result, not "it changed":
grayscale leaves r == g == b, bitmap only 0 and 255, indexed 4 only the
ladder 0/85/170/255, offset is a permutation (same sum and sum of
squares), equalize never narrows the range, inverting twice returns the
picture.

Two of those are judged against what the display can hold.  On a
256-cell PseudoColor map a second inversion of a 576-colour picture
drifts 42/255 -- the map, not the operation -- so the involution runs on
a four-colour picture (floor 0) and grayscale gets the 10/255 the
nearest-cell search costs.  The test prints the floor it measured (0 on
TrueColor, 30 on PseudoColor) instead of carrying a guessed tolerance.

XmLoc is now the one place that casts a catalogue string for
XmStringCreateLocalized: Tr promises const because its English fallback
is a literal, the widget asks for char *.  Six dialogs warned before,
the file builds without a single warning now.

Measured on Xvfb 1024x768x24 (:91) and x8 (:98): menutest, viewtest,
optest, selmodtest, retouchtest, selecttest, movetest, croptest,
typetest, drawtest, filtertest all PASS on both depths (22), plus
selftest PASS (64x48) on both -- 24 of 24 green, 0 build warnings.
2026-11-22 13:51:29 +00:00
lotherk 208ec91ba9 MCDE dtphoto: every menu path bound, the View switches drawn and read
All 206 paths of dtphoto.menu resolve to a command the callback switches
on.  The table had 43 doubled entries and 11 paths that named a menu
entry the menu does not have ("Image/Adjust/Image Size..." instead of
"Image/Image Size...", "@3.0" tags the reader already strips); both are
gone, CommandOf walks the table to its NULL entry, and -menutest now
proves the table against itself: 206 paths, 0 doubled, 0 bad, and an
unknown path stays CMD_NONE.  DTPHOTO_CMDS=1 used to bind 38, now 206,
none on CMD_NONE.

The View switches were flags nobody read.  SnapX/SnapY pull a marquee or
crop drag onto the grid or a guide a guide in reach wins over the grid,
Lock Guides refuses new and keeps existing ones), DrawGuides paints the
grid, the guides and the rulers on the canvas and not into the picture.

Two new headless tests, both green on depth 24 and depth 8:
  -viewtest  snapping arithmetic: 37 -> 32 on a 16 grid, 40 -> 48, a
             guide at 35 catches 37, a vertical guide leaves y alone,
             locked guides neither grow nor clear.
  -drawtest  counts the pixels on a real pixmap: grid 12509, one guide
             280 (= the canvas height), rulers 558 and none of them
             inside the canvas.

Measured: drawtest, viewtest, menutest, optest, selmodtest, retouchtest,
selecttest, movetest, croptest, typetest -> 20 green, 0 red (10 tests x
depth 24/depth 8); -selftest PASS on both, byte-identical output.
2026-11-22 13:09:53 +00:00
lotherk d6479ef90f MCDE: PNG, JPEG and GIF in dtphoto, one picture writer in libDtSvc
dtphoto read only BMP and ICO and wrote only BMP; PNG, JPEG and GIF were
listed as open in docs/MCDE-PROGRAMS.md since 2026-11-12.  The reader was
already there: McdeThumbRead in libDtSvc has all five formats, is X-free and
is what dtfile uses for its miniatures.  dtphoto calls it for everything its
own reader does not know, so the program carries no second decoder.

There was no picture writer anywhere in the tree, so McdeThumbWrite now sits
next to the reader: PNG through libpng's simplified API, BMP in C99, the
ending decides, an unknown ending is refused instead of silently becoming a
BMP.

Measured on Xvfb depth 24 (2026-11-22):
- 40x30 PNG -> PNG, 1200 of 1200 pixels identical, CRC checked.
- 40x30 GIF -> PNG, 0 of 1200 pixels different.
- 40x30 JPEG q100 -> PNG, at most 3 steps per channel (compression, not the
  reader); the same picture written from libpng is 0 steps.
- Depth 8: a 32-colour picture comes back 0 of 256 pixels different; a
  1200-colour ramp differs by mean 28.6/255, which is the colormap -- the
  same ramp is 0 on depth 24.

test_thumb writes a 13x7 ramp (every pixel unique) as PNG and BMP and reads
it back pixel for pixel.  Proved the test bites: writing the BMP rows
top-down turns it red at 78 of 91 pixels, PNG_FORMAT_BGR at 91 of 91.  The
unknown-ending and zero-size cases are checked too.

dtphoto: the file dialog filters on every format it reads, not on *.bmp.
All 18 dtphoto test modes stay green on depth 24 and depth 8, test_thumb ok.
2026-11-22 12:06:04 +00:00
lotherk d234b8be2e docs: README for the tree, drop harness-specific .claude config
README.md collects what Makronix is, the repository layout, the one build
entry point and its gate, the installer/desktop/media design, offline
sources, platforms, the documentation map and the contribution rules from
AGENTS.md, GOAL.md and docs/BUILD-CONTRACT.md. All relative links resolve.

Remove .claude/ from the repository and ignore it: AGENTS.md is the
harness-independent convention. Root AGENTS.md and tools/AGENTS.md now
describe tools/claude-build-gate.sh as a build gate rather than a Claude
hook; docs/reference/AGENTS.md notes the removal of the archived directory.

Verification: sh -n tools/claude-build-gate.sh ok; tools/claude-build-gate-test.sh
25 ok, 0 bad; git check-ignore -v .claude/settings.json matches /.claude/;
README links checked against the tree.
2026-11-22 12:04:30 +00:00
lotherk 028161f296 MCDE dtphoto: the Image and Filter menus carry real operations
Image: Invert, Desaturate, Brightness/Contrast, Flip horizontal/vertical,
Rotate 180/90 CW/90 CCW, Image Size and Canvas Size.  Filter: Blur,
Blur More, Sharpen, Sharpen More, Find Edges, Emboss, Solarize, Add Noise,
Median/Despeckle, Mosaic.  All of them read and write through the same RGB
buffer, so no operation costs an X round trip per pixel.

Two bugs found while wiring them:
 - A per-pixel correction ignored the selection.  Invert, Desaturate,
   Brightness and Solarize changed the whole picture even with a mask.
   They now share OpPerPixel, so a new operation cannot forget the mask.
 - A menu entry was bound by its label, but the reference has "Horizontal"
   in Image > Flip and in Layer > Type.  CommandOf takes the full path now
   ("Image/Flip/Horizontal"), the reader stores it in Item.path.

Verified, depth 24 and depth 8, 16 runs, 0 red:
 - -menutest: 31 paths each resolve to the command the callback switches
   on; an unknown path stays CMD_NONE.
 - -optest against the arithmetic, not "the picture changed": a hard edge
   blurred to 170 (six of nine window pixels white), the same edge
   sharpened clamped to 255 and 0, mosaic cells to their mean (100,30,128),
   noise deterministic and inside the range, mask inside changed and
   outside untouched.
 - -selftest on a 1024x768 24-bit BMP: byte-identical (2,359,350 bytes,
   0 differing).
 - -retouchtest -selecttest -movetest -croptest -typetest still green.
 - DTPHOTO_CMDS=1 reports 37 bound entries, the 11 Filter paths among them.
2026-11-22 11:05:24 +00:00
lotherk 30ff8ec5f5 MCDE dtphoto: the toolbox wired -- lasso, wand, move, crop, type, retouch
The selection was a rectangle, so the lasso, the magic wand and every
command that should honour a selected shape had nothing to work on.  It
is a bit mask now: the lasso collects a path, the wand floods by colour
distance, Select > Inverse and Edit > Clear read the same mask, and a
command paints only inside it.

Move and Crop had no press or motion branch at all -- two of the 22
buttons did nothing.  Move snapshots picture and mask at the press and
rebuilds from that snapshot on every motion event: rebuilding from the
last frame walks the pixels twice as far, and the release must not
recompute the offset, because a drag that ends on the frame gives a
position outside the canvas and moved the picture back.  Without a
selection it moves the whole picture, as the original does.  Crop drags
a rectangle and crops to it on release.  Type opens a prompt and draws
one line over an undo snapshot (the drawing moved out of the dialog
callback so it is reachable without a dialog).  The magnifier doubles on
the left button and halves on the right, the hand pans the view.

The six retouching tools (blur, sharpen, smudge, dodge, burn, sponge)
are new here -- dtpaint has none to copy -- and read a patch around the
dab in one GetImageRGB round trip, not one per pixel.

Two latent bugs found while testing: Unique() sorts the colour keys in
place but the bsearch afterwards ran over the reduced count, so lookups
past the holes failed (ReadPatch and GetImageRGB both had it), and
RGBToPixel returned 0 -- black -- when XAllocColor failed on a full
256-cell map, losing the pixel instead of taking the nearest cell.

Test evidence, headless, depth 24 and depth 8, all green:
  -movetest    10x10 block moved (10,5), mask travelled, background hole
  -croptest    40x30 -> 20x30, only blue kept
  -typetest    75 dark pixels, corner still white
  -selecttest  wand 800 of 2400 exact, inverse 1600, lasso in/out, clear
               only inside the mask
  -retouchtest all six tools move the values the expected way
  -selftest    1024x768 round trip PASS
Mouse-verified on Xvfb with xdotool: zoom 200% -> 400% -> 200%,
crop 1024x768 -> 200x150, move dragged twice (40,30 then 80,60) with
78,011 pixels changed.
2026-11-22 10:14:59 +00:00
lotherk cc7248c520 MCDE dtphoto: open and save through one RGB buffer, not per pixel (P1)
dtphoto allocated a colour in the server for every pixel it opened and
queried one for every pixel it saved -- one X round trip per pixel, the
same fault dtpaint lost on 2026-11-21.  dtpaint was carried over; dtphoto
was not.

The document now goes through an 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.  The
reader takes 24-bit BMP (bottom-up and top-down), 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; the save keeps the 2835 dpi fields the old writer wrote.
The selftest compares every pixel now, not a sample, and its two callers
pass a real file each instead of relying on a scratch document.

Measured on Xvfb (1280x1024x24), a 1024x768 24-bit BMP with 589,824
distinct colours, `dtphoto -selftest big.bmp out.bmp`: 20.3 s before the
change (the old binary, same picture, 20.326 s), 58-109 ms after (5 runs).
The round trip is byte-identical: 2,359,350 bytes, `cmp` silent, dpi
fields included.  depth 8 (PseudoColor, Xvfb 1280x1024x8): PASS, exact for
4- and 65536-colour documents alike.  8-bit BMP, RLE8 BMP, ICO 8 bpp and
ICO 32 bpp read exact on both depths (0 wrong pixels, /tmp/dtptest).
make in build/mcde-linux/programs/dtphoto: cc and libtool link exit=0, no
new warning (the two const warnings in XmStringCreateLocalized calls are
older than this change).

Documented in AGENTS.md and docs/MCDE-PROGRAMS.md (C1).
2026-11-22 08:28:41 +00:00
lotherk c543f7d910 docs: dtpaint D3/D4 (tools, formats, print) recorded
C3's status gains the 2026-11-22 paragraph: airbrush/text/curve/polygon,
rect/free selection with XOR marquee, move and Delete/Select All, zoom
1x-8x, Attributes, Edit Colors, 8-bit BMP (uncompressed and RLE8) and ICO
read, 24-bit BMP save, and Print through mcde_sys_print_file with the
temporary file removed when the job ends.  The physical page on the HP
printer stays the user's step; the spool path is verified with a fake lp.
AGENTS.md: the same in the dtpaint paragraph and the catalog count (51
messages, 52 free).
2026-11-22 07:31:31 +00:00
lotherk 7345dd867e MCDE: print a file through McdeSys; dtpaint Print... (D4)
McdeSys gains mcde_sys_print_file(path, printer): it looks for lp(1)
(/usr/bin, /usr/local/bin, /usr/sbin, pkg prefix; MCDE_PRINT_COMMAND
overrides it for tests), passes -d PRINTER when one is named, and runs it
as the existing job (fd into the event loop, finish/cancel).  dtpaint links
libMcdeSys, adds File > Print... (Ctrl+P): it picks the default queue from
mcde_sys_printers (or the first), writes the image to /tmp/dtpaint-PID.bmp,
starts the job and removes the file when the job ends; errors and 'no
printer is set up' go to the information dialog.  Measured under Xvfb with
MCDE_PRINT_COMMAND=fake lp: argv '-d HP_LaserJet_M110w_CC1016
/tmp/dtpaint-3543226.bmp', the fake copied a valid 640x480 BMP and the
temporary file was gone; no physical page was printed (the real queue is
the user's step).
2026-11-22 07:23:33 +00:00
lotherk 8712522231 MCDE dtpaint: 8-bit BMP (incl. RLE8) and ICO read (D4)
OpenBMP now dispatches on the file: 24-bit BMP keeps the proven path
(OpenBMP24), 8-bit palette BMP decodes uncompressed and RLE8 (count/value,
end-of-line, end-of-bitmap, delta, absolute runs with word padding, top-down
and bottom-up), and the first image of a .ico decodes 1/4/8/24/32 bpp
(BGRA with alpha 0 composited onto the background; PNG-compressed icons are
refused because there is no PNG decoder).  All three go through one RGB
buffer and SetImageRGB, which allocates distinct colours in one batch on
PseudoColor.  Measured under Xvfb: ImageMagick's RLE8 160x100 gradient opens
and shows the gradient; a 64x64 32-bpp ICO opens with its four colours;
24-bit -selftest still passes.
2026-11-22 07:18:21 +00:00
lotherk 9e23c837a6 MCDE dtpaint: image attributes and colour editor (D4)
Image > Attributes... (Ctrl+E) asks width and height (1..4096), builds a
new pixmap filled with the background, copies the overlap and discards the
selection; the resize is a document operation, so undo starts fresh after
it.  Colors > Edit Colors... opens three RGB scales initialised from the
current foreground; OK allocates the colour and updates the fg square.
Both dialogs are FormDialogs with OK/Cancel from the catalog; the form size
is set after popup so the shell does not shrink to its children.
Measured under Xvfb: 640x480 -> 300x300 canvas; Red 255 + OK draws a red
line and turns the fg indicator red.
2026-11-22 07:13:48 +00:00
lotherk 8ce2948157 MCDE dtpaint: rectangular and free-form selection (D3)
Select drags a box, Free-Form Select traces a lasso; both draw an XOR
marquee (scaled with the zoom), keep the pixels, and can be dragged to move
them: the snapshot is the undo base, the selected pixels float in a pixmap,
and a 1-bit polygon mask clips clear/paste for the lasso.  Edit > Clear
Selection (Del) clears the selected pixels and deselects; Edit > Select All
(Ctrl+A) selects the whole image; the Clear Selection item is sensitive only
while a selection exists.  A non-selection tool's click deselects, as in the
reference.  Measured under Xvfb: box marquee, move of a scribble (outside
pixels stay), Delete clears it, lasso marquee around a dot and Delete clears
just that dot, Ctrl+A marks the image and enables the menu item.
2026-11-22 07:05:29 +00:00
lotherk 96f4ff6412 MCDE dtpaint: curve and polygon tools (D3)
Curve is the reference's two-phase tool: drag the two end points, release,
then move to bend the quadratic Bezier and click to commit.  Polygon adds a
vertex per left click, previews the open outline with a rubber line to the
pointer, and closes on a right click or a double click; leaving the tool
restores the snapshot.  Both keep the one-step undo (snapshot at the first
press).  Measured under Xvfb: a bent curve from (300,200) to (500,300)
through (400,150); a closed quadrilateral; Undo removes the polygon and
keeps the earlier curve.
2026-11-22 06:59:01 +00:00
lotherk b3b0b3a575 MCDE dtpaint: airbrush and text tools (D3)
Airbrush sprays random foreground/background dots in a 15-pixel square
while dragging; Text opens a prompt dialog, then fills the text box with
the background colour and draws the string in the foreground colour with
the GC's font (the image stays 1:1 at any zoom).  The prompt's OK button
is a gadget whose callback widget is the SelectionBox itself, so the text
field is found there, not under XtParent.  Measured under Xvfb: spray dots
on the canvas; 'Hello dtpaint' appears at the clicked point.
2026-11-22 06:56:08 +00:00
lotherk 186d13324d MCDE dtpaint: zoom 1x/2x/4x/8x (D3)
The magnifier cycles the factor (left up, right down); View > Normal Size
(Ctrl+PgUp) and Large Size (Ctrl+PgDn) set 1x and 4x.  The canvas grows to
image*zoom inside the scrolled window; Expose samples only the exposed
rectangle into an XImage (nearest pixel), and pointer events divide by the
factor, so drawing and the status line stay in image coordinates.
Measured under Xvfb: 1x 640x480 -> 2x 1280x960 -> 4x 2560x1920, a line
drawn at 4x appears at the same image coordinates at 1x.
2026-11-22 06:51:21 +00:00
lotherk 25c9e4ee7d MCDE dtpaint: Ctrl+S kept the path and title (t0704 follow-up)
DoSave(curPath) passed curPath as both the destination and the source of
snprintf, which is undefined; glibc emptied it, so after Ctrl+S the title
fell back to 'untitled' and the next Save opened Save As again.  Copy only
when the pointers differ.  Found while verifying the PseudoColor path on
Xvfb depth 8 (4-colour BMP round trip exact, selftest PASS); recorded in
AGENTS.md.
2026-11-22 05:50:22 +00:00
lotherk 1313c9fd59 mcde dtsystemsettings: include ScrolledW.h (missing, broke every full build)
main.c uses xmScrolledWindowWidgetClass (paneScroll, added in ad02893dde)
but never included <Xm/ScrolledW.h>, so any full make install / the MCDE
PLIST gate died at dtsystemsettings-main.o with 'xmScrolledWindowWidgetClass
undeclared'.  One include, alphabetical among the Xm headers.  Found while
running the PLIST gate for the dtpaint review (t0704); -fsyntax-only clean.
2026-11-21 21:42:46 +00:00
lotherk 0ee7098d0f MCDE dtpaint: the review's defects -- crash, undo, menus, save, i18n, speed (t0704)
Review of programs/dtpaint found and this fixes:
- Picker crash: a click in the grey strip below the image reached
  XGetImage outside the pixmap (BadMatch, X_GetImage).  The canvas is now
  a drawing area of exactly the image size inside a scrolled window, and
  CanvasInput bounds-checks; large BMPs scroll instead of being clipped.
- Undo: one snapshot taken before every image-changing operation (pencil,
  brush, eraser, fill, shapes, invert, flip, clear) and refreshed after a
  load; previously only shape tools snapshotted and OpenBMP left snap
  uninitialized, so Undo after Open turned the image black.
- Menus: Clear Selection and Edit Colors were wired to Clear Image and
  About; they are now insensitive until D3/D4.  Help Topics is real.
  Accelerator text shown; Clear Image uses 'Ctrl Shift<Key>N' (the old
  'Ctrl<Key>Shift<Key>N' never fired).
- Save remembers the path and title, asks before New/Open/Exit when
  dirty (Discard/Keep), and reports open/save errors in a dialog instead
  of stderr; the per-tool-change stderr debug is gone.
- Colour model: fg/bg are pixels (picker takes any colour, right button
  sets background) with a drawn fg/bg indicator; toolbox is radio with
  the indicator hidden (one sunken tool); swatches are 16x16.
- Open/Save/Invert no longer do one X round trip per pixel: TrueColor
  converts through the visual's masks, other visuals batch the distinct
  colours.  Measured on a 1024x768 BMP: open 18.3 s -> 0.02 s, invert
  14.9 s -> 0.05 s, save 6.3 s -> 0.23 s.
- FloodFill is scanline with a growing seed stack, not 4 neighbours per
  pixel; XmString leaks freed; message dialogs destroy their shell.
- Catalog grows to 34 messages; the German copy transliterates umlauts
  (core font has no UTF-8 rendition), re-measured under de_DE.UTF-8.
-selftest now also checks the BMP round trip and double invert/flip: PASS.
Builds clean under -Wall -Wextra -Werror; PLIST gate ok (3714 installed).
Left column is a Form so the colour box never overlaps the canvas.
2026-11-21 21:42:34 +00:00
lotherk ad02893dde mcde: one window size for System Settings, tabs that are one of many, icons that exist
- dtsystemsettings: the shell is 1022x550 and stays so (min/max equal); every
  pane lives in it instead of growing the window (thirteen per-pane
  XtVaSetValues(shell, width, height) calls are gone), and a taller pane
  scrolls (the pages sit in an XmScrolledWindow with XmAUTOMATIC).
- panes.c: CDs & DVDs had no icon (Dtmedia.m.pm does not exist) - it shows
  IrixCD.m.pm; Energy Saver shows SDtpowermgr.m.pm; Accounts had the same icon
  as Startup (DtStart.pm) and shows McdeUser.t.pm.  The "Startup Disk" entry
  and the disabled "Dock" entry (no icon, PANE_LATER) are removed.
- McdePrefs: the tab strip is one of many (XmNradioBehavior,
  XmNradioAlwaysOne).  Without it every visited tab stayed pressed
  (measured 2026-11-21: Keyboard, Mouse and Shortcuts all down at once).
- dttoolbox: the window title is "dttoolchest" (msg 1 of the catalog).
- McdeSys: mcde_sys_keyboard_is_mac asks the machine (hw.model "Mac...")
  before usbdevs.  At session start the internal keyboard may not be
  enumerated yet, so dtkeys took a MacBook for a PC keyboard and exchanged
  Alt and Command (_MCDE_KEYS said "pc", measured 2026-11-21).

Measured on the MacBook: keyboard _MCDE_KEYS "pc" with an Apple Internal
Keyboard / Trackpad on usb1 port 2 addr 7.
2026-11-21 20:15:43 +00:00
lotherkandClaude Opus 5.5 118b19a171 make usb: remove the image's work files before and after the build; keep one image backup
The install image left about 34 GB of work files in build/obj/distrib/amd64/
installimage (work/, work.rootfs, imgroot.fs, work.img), and a killed run
left install(1)'s temporary copy in RELEASEDIR/images (6.3 GB,
Makronix-0.99.11-amd64-install.img.inst.f7YyCj).  The root disk was at 99%
(15 GB free) while make usb still had 20 GB to write.

make usb now runs NetBSD's clean target of Makefile.bootimage before and
after install-image and removes *.img.inst.* first.  keep-images.sh keeps
one build/keep-* by default instead of two (each holds 10-20 GB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 19:31:40 +00:00
lotherk b2a65a76df kernel: GENERIC again, plus every USB driver GENERIC leaves out
The release kernel panicked on real hardware at boot (IRQ 6, a lock error).
It carried ALL's options (PCI_INTR_FIXUP, PCIBIOS_INTR_GUESS,
PCIBIOS_IRQS_HINT, COMPAT_*, ...) and ALL's drivers that GENERIC lacks,
experimental ACPI ones among them.  Konrad, 2026-11-18: 'revert mal die
ganze ALL kacke. einfach GENERIC aber mit allem was usb angeht'.

- makronix_workstation.config: back to 866df91be6 (multi-head consoles,
  four screens, the splash), plus the include below.
- makronix_devices.config: only the USB drivers of dev/usb that
  usbdevices.config leaves out: uatp (+wsmouse), umb, uhmodem (+ucom),
  gscan (with options CAN).
- GENERIC: the console colours white on black directly, instead of an
  override that made config(1) warn.

nbconfig GENERIC, INSTALL, GENERIC_KASLR: exit 0, no warnings; the four USB
drivers are in the kernel Makefile.
2026-11-18 16:03:37 +00:00
lotherk 91c13b435f make release: show each step, run the media steps from the top directory
Each of the five steps prints '==> make release [time] n/5 what', the last
line says 'done' or which step failed with its exit code (Konrad: release
should show its steps, not nothing).  build.sh starts with 'cd src': it runs
in a subshell now, and sourcesets/iso/usb are called with -C $(TOP) -- in
b207c2c8ad they would have run in src/ against NetBSD's own Makefile.
2026-11-18 14:22:29 +00:00
lotherk b207c2c8ad make release builds the whole release: sets, source set, ISO, USB image
Konrad, 2026-11-18: 'make release heisst ein RELEASE, ein RELEASE enthaelt
natuerlich ALLES'.  release now runs build.sh release, then sourcesets, iso
and usb inside its own (re-entrant) lock; iso and usb keep checking the stamp
with -c, so nothing built in the same run is discarded.  cdtest no longer
calls iso a second time.  AGENTS.md and docs/BUILD-CONTRACT.md say so.
2026-11-18 14:21:06 +00:00
lotherk 4db19eff54 make usb: create the install image's object directory first
build.sh install-image runs no 'make obj'.  With
build/obj/distrib/amd64/installimage removed (by hand, 2026-11-18) nbmake
built the image inside src/distrib/amd64/installimage; the untracked files
there are part of build-stamp's key, so the next make release/iso/usb
stopped with 'sources changed'.  usb now makes the directory before
build.sh.
2026-11-18 14:14:09 +00:00
lotherk 79c50e2781 mcde: distinfo of the archive with dtlogin's LANG order
test-desktop-login on the installed VM with this dtlogin: 12 of 12 PASS,
the session runs with LANG=en_US.UTF-8 (build/logs/desktop-login-2026-11-18f.log).
2026-11-18 12:38:05 +00:00
lotherk f5a42ab966 dtlogin: LANG before PATH in the session environment (ksh93 dropped it)
The session ran with LANG=C although dtlogin passed LANG=en_US.UTF-8 to
Xsession (dtlogin -debug 3: 'LANG=en_US.UTF-8'; ps -e on Xsession showed it).
Xsession is a ksh93 script, and ksh93 93u+m 1.0.10 on NetBSD rejects LANG as
'en_US.UTF-8: unknown locale' and leaves it empty when PATH comes earlier in
the environment (put_lang -> libast setlocale); Xsession then set LANG=C.
Measured in the installed system: env -i PATH=/bin:/usr/bin LANG=en_US.UTF-8
ksh93 -> empty, LANG before PATH -> kept, no PATH -> kept.  verify.c now
creates LANG right after LOGNAME; setLang() replaces the value in place.

Tests: test-desktop-login's LOGIN and CORES checks matched padded ps and wc
output ('CORES= 0'); install-simple's .local lookup is bounded to 5 s per
round (the loop outlasted ENDCHK's 300 s without a network).
2026-11-18 12:28:02 +00:00
lotherk ef5f4457c6 mcde: distinfo of the archive with the session fixes (libSM ID, locale, fonts, catalogues, ICE) 2026-11-18 06:49:26 +00:00
lotherk f5eabee88d test-desktop-login: wait for the greeter's window, check LANG and core files
dtgreet is in the process list before its window takes keys; typing 3 s
later lost the user name, 12 s did not.  New checks: the session's LANG is
en_US.UTF-8 (the default), and no core file is in the user's home (that is
how dtsession died, 2026-11-18).
2026-11-18 06:39:13 +00:00
lotherk c70142ff80 dtlogin: /tmp/.ICE-unix for the session manager
libICE creates it only as root and NetBSD creates it nowhere; the session
log said '_IceTransmkdir: ERROR: euid != 0, directory /tmp/.ICE-unix will not
be created' and dtsession had no local ICE socket, its clients going over
TCP to the host name (2026-11-18).  dtlogin (root) makes it 1777 next to
/var/dt, as libICE itself would.
2026-11-18 06:38:50 +00:00
lotherk 37d69afa35 mcde: message catalogues in NetBSD's format (nbgencat from the tooldir)
configure took the build host's gencat; on Linux it wrote glibc catalogues
(magic 0x960408de, dtfile.cat in the makronix set) which NetBSD's catopen(3)
rejects (src/lib/libc/nls/catopen.c:183, _NLS_MAGIC 0xff88ff89): catgets()
always returned the built-in English, translations never showed.  The
tooldir's nbgencat writes the NetBSD format; a native NetBSD host keeps its
own gencat.
2026-11-18 06:38:20 +00:00
lotherk abc7760535 dtsession: *Font and *FontSet name their charset (menus were Chinese)
sys.resources/sys.font gave *Font and *FontSet as
'-dt-interface user-medium-r-normal-m*-*-*-*-*-*-*-*-*'.  The first match the
server lists for that alias is ...-gb2312.1980-0, a two-byte font: Motif drew
ASCII two bytes per glyph and every menu bar, label and the dtbar status read
as Chinese ('Fi' = 0xC6E9 = GB2312 '崎').  With iso8859-1 named, dtfile's labels
read 'Back', 'Forward', 'DEVICES' (xrdb -merge in the installed VM,
2026-11-18).
2026-11-18 06:37:48 +00:00
lotherk 1733d4f374 mcde: en_US.UTF-8 by default, paths in the actions, the cursor path
- dtlogin Xconfig: Dtlogin*language en_US.UTF-8 on NetBSD.  dtlogin has
  no DEF_LANG there and rc.d passes no LANG: every session ran with LANG=C
  (Konrad, 2026-11-18: 'default soll en_US.UTF-8 sein').
- types/Makefile.am: tradcpp does not expand macros inside '...', and the
  actions quote their commands; 'CDE_INSTALLATION_TOP/bin/dthelpgen' reached
  dthelp.dt, dt.dt, dtfile.dt, uxstd.dt, develop.dt, xclients.dt unexpanded
  ('sh: CDE_INSTALLATION_TOP/bin/dthelpgen: not found' in ~/.dt/errorlog).
  The paths are filled in by sed after cpp.
- 0079.dtcursor: $CDE_INSTALLATION_TOP is no session variable (the path
  was /share/icons); derived from DT_BINPATH.
2026-11-18 06:28:45 +00:00
lotherk e832386332 libSM: client IDs from uuid_create(3); dtsession refuses a NULL ID
The login went back to the greeter: dtsession dumped core
(~/dtsession.core, SIGSEGV in strlen <- strdup <- SmsRegisterClientReply
<- SmXSMP.c:562, return address 0x1fb5c in the PIE).  NetBSD builds libSM
without UUID support, so SmsGenerateClientID derives the ID from the host
name's address and returns NULL when the name does not resolve (sm_genid.c,
getaddrinfo) -- an offline machine whose name is not in /etc/hosts, the
installed test VM, the workstation without network.

- src/external/mit/xorg/lib/libSM/Makefile: -DHAVE_UUID_CREATE, libc's DCE
  uuid_create/uuid_to_string (the branch sm_genid.c has for FreeBSD).
- dtsession SmXSMP.c: a NULL ID refuses that client instead of killing the
  session manager.
2026-11-18 06:18:50 +00:00
lotherk d796ead989 dtlogin: the NetBSD server keeps the pseudo-user (as CDE has it)
Running it as root made it enforce access control, and the display manager's
own connection then failed before the greeter ('Authorization required, but
no authorization protocol specified').  As nobody it cannot read the -auth
file and serves without access control, which is how this display has always
worked; the session now uses the user's ~/.Xauthority (previous commit).
2026-11-18 05:43:16 +00:00
lotherk 06fd00859b dtlogin: the parent presents the cookie to its own server
With the server running as root it enforces access control (it can read
-auth now), and WaitForServer's XOpenDisplay in the parent had no
authorization: 'Authorization required, but no authorization protocol
specified' and 'Server for display :0 can't be started' (2026-11-18).
SetAuthorization(d) is called before the wait, as the server child already
did.
2026-11-18 05:29:32 +00:00
lotherk 5764998fc2 install-simple: answer the museum question by its text, longer ENDCHK wait
The museum message's title is cut by the screen handling ('...qqqj(B Museum?'),
so the test hung there; its body names it.  The checks' own loops (mdnsd name,
Xorg) can take more than 150 s, which made the test fail after a correct
install (2026-11-18).
2026-11-18 05:04:50 +00:00
lotherk 421acd562e dtlogin: the session keeps the user's Xauthority
SetUserAuthorization() writes ~/.Xauthority for the user (and sets
XAUTHORITY itself when it has to use the fallback file), but the session
environment then named the server's auth file -- 0600 root, unreadable for
the user.  dtsession could not open the display and dtlogin went back to the
greeter (measured 2026-11-18; dtsession runs fine when XAUTHORITY names
~/.Xauthority).
2026-11-18 05:04:33 +00:00
lotherk d80cee775a dtlogin: the server as root, and /var/dt writable for the session
Two causes of 'the login goes back to the greeter', both measured in the
installed VM 2026-11-18:

- Xservers.src ran the server as the pseudo-user nobody on NetBSD; it could
  not read its own -auth file (0600 root) and the session could not open the
  display.  NetBSD's xdm runs the server as root; NetBSD gets
  local_uid@console root now, as Solaris and OpenBSD already had.
- dm.c's dtMakeDefaultDir made /var/dt/appconfig and appmanager 0755 root;
  dtsession creates its directory there as the user and died with
  'MakeDirectory: /var/dt/appconfig/appmanager/<user>-<host>: Permission
  denied'.  appconfig and appmanager are 0777, tmp is 1777.
2026-11-18 04:32:38 +00:00
lotherk d102515dc2 mcde: distinfo of the archive with the sessreg and userPath fix 2026-11-18 02:16:08 +00:00
lotherk bc781a9e6a mcde: sessreg's path -- the session setup failed and dtlogin went back to the greeter
Xstartup's last line is 'exec sessreg -a ...' and Xreset's 'sessreg -d ...'.
configure (AC_CHECK_PROGS(SESSREG, sessreg)) recorded the bare name from the
build host, and Dtlogin*userPath had no /usr/X11R7/bin -- where NetBSD's
sessreg is.  The session setup died with 'Xstartup[57]: exec: sessreg: not
found', dtlogin restarted the greeter: the password was accepted and the
login bounced (measured in the installed VM 2026-11-18, Xerrors).

- pkgsrc/Makefile: ac_cv_prog_SESSREG=/bin/sessreg
- dtlogin/config/Xconfig.src: NetBSD's userPath carries /usr/X11R7/bin
  (xrdb, xset, xmodmap too)
- tools/install-simple.sh: answer the museum question (it hung there)
- tools/test-desktop-login.sh: the greeter test rebuilt: root shell first,
  wait for X and dtgreet before typing (keys sent too early were lost), -g
  restarts dtlogin with -debug.
2026-11-18 02:02:19 +00:00