From c82e6dad5cd2b9813f5df982fe9710429c24e81e Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Fri, 23 Jan 2026 23:38:32 -0500 Subject: [PATCH] wmaker: set the window manager's information According to EWMH specification, the active window manager is supposed to set some information. Those can be gathered for example with 'wmctrl -m'. Before the patch: $ wmctrl -m Name: N/A Class: N/A PID: N/A Window manager's "showing the desktop" mode: OFF After the patch: $ wmctrl -m Name: Window Maker 0.96.0 Class: wmaker PID: 6866 Window manager's "showing the desktop" mode: OFF --- src/wmspec.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/wmspec.c b/src/wmspec.c index e61e6ae7..fe313410 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -32,7 +32,9 @@ #include #include +#include #include +#include #include #include "WindowMaker.h" @@ -274,6 +276,9 @@ static void setSupportedHints(WScreen *scr) { Atom atom[wlengthof(atomNames)]; int i = 0; + long pid = 0; + char wm_name[64] = ""; + XClassHint *class_hint; /* set supported hints list */ /* XXX: extend this !!! */ @@ -357,6 +362,25 @@ static void setSupportedHints(WScreen *scr) XChangeProperty(dpy, scr->info_window, net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *)&scr->info_window, 1); + + /* set _NET_WM_NAME on supporting window */ + snprintf(wm_name, sizeof(wm_name), "Window Maker %s", VERSION); + XChangeProperty(dpy, scr->info_window, net_wm_name, utf8_string, 8, + PropModeReplace, (unsigned char *)wm_name, strlen(wm_name)); + + /* set _NET_WM_PID on supporting window */ + pid = getpid(); + XChangeProperty(dpy, scr->info_window, net_wm_pid, XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&pid, 1); + + /* set WM_CLASS on supporting window */ + class_hint = XAllocClassHint(); + if (class_hint) { + class_hint->res_name = "wmaker"; + class_hint->res_class = "WindowMaker"; + XSetClassHint(dpy, scr->info_window, class_hint); + XFree(class_hint); + } } void wNETWMUpdateDesktop(WScreen *scr)