Commit Graph
6 Commits
Author SHA1 Message Date
lotherkandClaude Sonnet 5.5 e9d38270a3 dtlaunch: the clipboard history is opt-in and leaves passwords out (t0080 2')
What was copied is shown on the screen the moment the launcher opens, so a
password from a password manager sat there in clear.

- Dtlaunch*clipboardHistory, default False.  Off: nothing is asked of the
  clipboard's owner (no XFixes watch, no poll) and the hint line drops "the
  clipboard".  System Settings > Keyboard & Mouse > Shortcuts has the toggle
  "The launcher keeps a history of what was copied"; it writes the resource
  like the hot key does and restarts the launcher.
- On: a text that is new is kept only if its owner does not offer the target
  x-kde-passwordManagerHint with the value "secret" (what KeePassXC, KDE Wallet
  and others set; docs/reference/clipboard-password-hint.txt has the two
  sources and what they do not say).  An unchanged clipboard costs no second
  request.  The copy of the text is overwritten after use.

Measured (Xvfb, a small X program as the password manager, logging requests):
on: owners "ordinary-text-123" (no hint target), "hunter2-PASSWORD" (hint
"secret"), "second-ordinary-456": each got UTF8_STRING then the hint request;
the list shows the two ordinary texts, not the password.  Off (no resource):
0 requests in total, empty list.  The toggle in the real dtsystemsettings gives
the resource True, False, True; the indicator changes; the note fits.  Cross
compile (build's flags): dtlaunch.c and input.c without a warning; make check
of dtlaunch passes.  Not verified: a real password manager (the assumption
that its MIME type is an X11 target of that name is written in the reference
file), a launcher restart on a real session.  The default is the task's; one
word in dtlaunch.c's resource table turns it back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:37:01 +00:00
lotherk 020dd9ff5d MCDE dtsystemsettings: Security, three tabs (t0157)
New programs/dtsystemsettings/security.c with the reference's three tabs:

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

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

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

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

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

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

Not measured, because this host is not NetBSD or has no root: swapping
vm.swap_encrypt, reading cgd volumes, the npf state and writing npf rules.
They are the follow-up task for the VM.
2026-11-14 12:44:32 +00:00
lotherkandClaude Sonnet 5.5 d53ea094e7 licence: CNCL for what Makronix wrote itself
LICENSE at the root; the 103 files new in ext/src/mcde (none was in the CDE
import) carry the CNCL line instead of the LGPL notice.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 11:48:02 +00:00
lotherk 67315ef458 MCDE dtsystemsettings: Keyboard & Mouse with three tabs (t0129)
The two panes Keyboard and Mouse are one pane with the reference's tabs --
Keyboard | Mouse | Shortcuts; -pane keyboard, -pane mouse (and -pane
shortcuts) still work and open that tab (PaneFind maps the old ids onto the
pane and ShowPane passes the id).

Keyboard: repeat, its delay and rate, key click, the kind of keyboard (auto,
PC, Mac), the try-it field, and "Modifier Keys...": a dialog with four menus
(Caps Lock, Control, Option, Command -> one of the four functions or No
Action).  The dialog writes the same ~/.dt/keyboard dtkeys reads and runs
"dtkeys auto" at once.

dtkeys gained the modifier functions: the four physical keys come out of
Lock/Control/Mod1/Mod4 and into the modifier their function asks for
(XChangeKeyboardMapping + XSetModifierMapping, Xlib only, no setxkbmap), and
it runs at login as before (Xsession.d/0072.dtkeys).  It also reads the file
without dropping its lines when the kind changes.

Mouse: as before plus the wheel's direction (buttons 4 and 5 change places,
natural scrolling; the map goes to dtsession with the rest).  How far one
turn scrolls is the program's own step -- said in the pane.

Shortcuts: the keys of the desktop in a list (name, key, where it lives,
from ~/.dt/shortcuts; Launcher=... is written).  The launcher's key is live:
type a chord, Change writes Dtlaunch*hotkey and ~/.dt/shortcuts, then
"dtlaunch -quit" (new: asks the running launcher to let go of its key and
waits until the selection has no owner) and a fresh dtlaunch grabs the new
key.  Restore Defaults puts Cmd+space back.  The other rows are a record:
their keys are dtwm's and the app-defaults', and the pane says so.

"Full keyboard access" (the reference's text boxes / all controls) is left
out: Motif's focus traversal with Tab is always there and there is no switch
to turn it into two levels.

Measured under Xvfb with xdotool:

  - Modifier Keys: Caps Lock -> Control, Apply -> ~/.dt/keyboard says
    "capslock: control"; the key map then has keycode 66 = Control_L, Lock
    empty, Control 37/66/105 (read with an Xlib program; the pane keeps the
    display alive, so Xvfb does not reset the map when dtkeys exits).
  - Shortcuts: Launcher + "Cmd+j" + Change -> RESOURCE_MANAGER has
    Dtlaunch*hotkey: Cmd+j, ~/.dt/shortcuts has Launcher=Cmd+j, the running
    launcher is replaced and Cmd+j opens it (docs/screenshots/leopard/
    System-Preferences-Keyboard-and-Mouse-Shortcuts-mcde.png shows the list
    and the note; the picture with the open launcher after Cmd+j is the same
    run).
  - Wheel: "Scrolls down when turned towards you" -> xmodmap -pp: physical
    4 -> code 5, 5 -> 4.
  - -pane mouse opens the Mouse tab.
  - make check: test_panes PASS (new alias checks).

Pictures: System-Preferences-Keyboard-and-Mouse-mcde.png (Keyboard),
...-Mouse-mcde.png, ...-Shortcuts-mcde.png.

Open: only the launcher's key is changeable at runtime; the others are a
record (dtwm and app-defaults own them); the scroll step and Full keyboard
access are left out with the reason above; the modifier dialog keeps its
size after the first open.
2026-11-14 10:26:11 +00:00
lotherkandClaude Opus 5.5 1b2f0c6b58 mcde: System Settings: the kind of keyboard, and how windows take the focus
Keyboard chooses which key is Command (find out, PC, Macintosh) and runs
dtkeys at once; Mouse has "The focus follows the pointer" and "The active
window comes to the front", applied as the Style Manager applies them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:34:37 +00:00
lotherkandClaude Opus 5.5 c0bf505c0a mcde: keyboard and mouse in System Settings; dtsession keeps them
dtsystemsettings draws the Keyboard pane (key repeat, its delay and rate,
key click, a field to try it) and the Mouse pane (primary button, pointer
speed, threshold, double-click time) instead of opening dtstyle.  A change
takes effect at once through Xlib and goes to dtsession as dtstyle sends
it (_DT_SM_KEYBOARD_INFO, _DT_SM_POINTER_INFO; *multiClickTime through
_DtAddToResource).

dtsession saves and restores the XKB repeat delay and interval
(XkbGetAutoRepeatRate at logout, XkbSetAutoRepeatRate at login), which the
core keyboard state does not carry.  And it keeps every pointer button: the
map was char[5], the parse of the property wrote past it without a bound,
and the restore cut the map to 5, which the server refuses on a mouse with
more buttons.

Measured on Xvfb (build/mcde-shots): the sliders set the server (xset q:
delay 490, rate 29, click 20; acceleration 3/1, multiClickTime 280; xmodmap
-pp 1->3, 3->1).  Through a whole dtsession: logout wrote RepeatDelay 490,
RepeatInterval 34, ButtonMap 3,2,1,4,...,10 (10 buttons), AccelNum 3; the
next login restored delay 490 rate 29, acceleration 3/1 and the swapped
buttons.  The double-click time is saved (dt.resources) but its restore is
not measured: a dtsession started without Xsession gets no resources
loaded (3 in xrdb, against 108 in a real session).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:30:58 +00:00