From fed6f4c29489bef03ae965ce35f0777dfacefbda Mon Sep 17 00:00:00 2001 From: lotherk Date: Sun, 22 Nov 2026 09:53:16 +0100 Subject: [PATCH] dtwm: the panel says which pointer it wants The busy cursor was created and thrown away (_DtGetHourGlassCursor's return value went nowhere), so BUSY_START defined cursor None on the panel and the pointer fell back to whatever the shell had inherited. On the MacBook that was a black 16x16 square (measured with XFixes: 16x16, hotspot 8,8, every pixel black, serial 16) over the whole front panel, while the root and the xterm showed the arrow and the I-beam. The return value is kept now, and the panel defines the standard arrow on itself when it is mapped instead of inheriting one from its frame. Measured: make -C programs/dtwm rc=0, 0 errors (build/logs/dtwm-cursor.log). --- programs/dtwm/UI.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/programs/dtwm/UI.c b/programs/dtwm/UI.c index a4a24a3d..20ffd4be 100644 --- a/programs/dtwm/UI.c +++ b/programs/dtwm/UI.c @@ -62,6 +62,7 @@ #include #include +#include #include #include @@ -105,6 +106,7 @@ extern void DeleteControlActionList (ControlData *); extern Boolean CheckOtherMonitorsOn (SubpanelData *); static void Initialize (DtPanelShellWidget); +static void PanelMapped (Widget, XtPointer, XtPointer); static void BoxCreate (); static Widget PanelControlCreate (Widget, char *, String); static void MainControlCreate (int); @@ -192,6 +194,7 @@ FrontPanelCreate (Widget toplevel) XtSetArg (al[ac], XmNmwmDecorations, MWM_DECOR_BORDER); ac++; panel.shell = XtCreatePopupShell (panel_name, dtPanelShellWidgetClass, toplevel, al, ac); + XtAddCallback (panel.shell, XmNmapCallback, PanelMapped, NULL); panel_shell = (DtPanelShellWidget) panel.shell; @@ -384,6 +387,25 @@ FrontPanelCreate (Widget toplevel) * ************************************************************************/ + +/* The panel's pointer: the standard arrow, defined on the shell itself. A + * window without a cursor of its own inherits its parent's, and the frame + * dtwm gives the panel carried a black 16x16 cursor on this server (measured + * 2026-11-21); the panel is a place to click, so it says which pointer it + * wants instead of inheriting one. */ +static void +PanelMapped(Widget w, XtPointer cd, XtPointer call) +{ + Cursor arrow; + + (void) cd; (void) call; + arrow = XCreateFontCursor(XtDisplay(w), XC_left_ptr); + if (arrow != None) { + XDefineCursor(XtDisplay(w), XtWindow(w), arrow); + XFreeCursor(XtDisplay(w), arrow); + } +} + static void Initialize (DtPanelShellWidget panel_shell) @@ -407,9 +429,12 @@ Initialize (DtPanelShellWidget panel_shell) unsigned int size; - /* Create busy cursor. */ + /* Create busy cursor. The return value used to be thrown away, so + * BUSY_START defined cursor None on the panel and the pointer fell back + * to whatever the shell had inherited (a black 16x16 square on this + * server, measured 2026-11-21: XFixes 16x16, hotspot 8,8, all black). */ - _DtGetHourGlassCursor(display); + panel.busy_cursor = _DtGetHourGlassCursor(display); panel.resolution = (int) (intptr_t) panel.element_values[PANEL_RESOLUTION].parsed_value;