Files
mcde/programs
lotherkandClaude Sonnet 5.5 1ea27d7b8d MCDE dttoolbox: told of the published menu, not polling every 500 ms; the rebuild no longer crashes (t0080)
The menu the desktop publishes (_SGI_MENU_Selected on the window named by the
root property _SGI__MENU_WINDOW) was read on a 500 ms timer, two atom lookups and
two property reads each time.  main now looks at PropertyNotify itself (Xt
routes no event for a foreign window to a widget; dtlaunch's loop does the
same) and selects the menu window's property events before reading the text.

Measured: idle writes to the X socket in 10 s (strace) 20 before, 0 after; the
publisher scenario (2, 3, then 1 entries) is reported at 0.01 s, 3.001 s and
7.001 s.

Two defects of the old code, found by the control run: (1) the third change of
a menu with children died with SIGSEGV in XtDestroyWidget -- the loop walked the
parent's own XmNchildren array while every destroy shortened it; the list is
copied first.  (2) A rebuild deferred because the menu was open recorded the
text as seen and never built it; the text is forgotten now and one 1 s timer
retries, only while that waits.  The deferred path is not exercised by the
harness.

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