Files
mcde/programs/icons
lotherk 1387120c78 MCDE dtbar: a Displays menu in the status area (t0141)
The bar has a monitor icon next to the network one.  Its menu is the
reference's: "Detect Displays", then how many displays RandR reports, each
monitor with its size ("screen: 1024x768", primary marked), the modes of the
first monitor ("* 1024 x 768, 0 Hz" -- the current one marked), and
"Displays Preferences..." which opens System Settings > Displays.

Choosing a mode applies it (McdeDispApply, the same library the pane uses)
and asks "Keep these display settings?  Without an answer they go back in 15
seconds" with Keep and Revert; the timer puts the old set back.  "Detect
Displays" reads RandR again and runs dtsystemsettings -apply-displays, as
Xsession.d/0071.displays does at login.  The menu reads the displays when it
opens only -- no timer, no polling.

The icon is new: programs/icons/DtScrn.t.pm (a 16x16 monitor), in the icon
list of its Makefile.

Measured under Xvfb with xdotool:

  - the menu opens with "Detect Displays", "1 display", "screen: 1024x768",
    "* 1024 x 768, 0 Hz" and "Displays Preferences..." (docs/screenshots/
    leopard/Menu-Bar-Displays-mcde.png);
  - Displays Preferences... starts dtsystemsettings and the Displays pane
    appears (1024 x 768, the monitor "screen", rotation Normal);
  - choosing the mode opens the question, and 17 seconds later the dialog is
    gone and the displays were put back (xwininfo: no "Display Settings"
    window; the mode is the one before).

The mode switch cannot be measured on a second mode here: the Xvfb screen
has one mode and refuses new ones (xrandr --newmode/--addmode: "cannot find
mode", maximum 1024x768), and changing the developer's real display is a
hazard (AGENTS.md).  So the path ran with the current mode; the apply, the
question and the revert are what was exercised.

Open: "show displays in the bar" as a switch in the Displays pane, and
rebuilding the menu on RRScreenChangeNotify instead of at open (the menu
reads no timer, but a monitor plugged in shows on the next open).
2026-11-14 11:02:00 +00:00
..