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).
This commit is contained in:
lotherk committed 2026-11-22 09:53:16 +01:00
1 parent 7589f2ea15
commit fed6f4c294
1 file changed
+27 -2
+27 -2
View File
@@ -62,6 +62,7 @@
#include <Xm/TextF.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#include <X11/keysymdef.h>
#include <langinfo.h>
@@ -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;