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;