[PATCH] wmaker: set the window manager's information

13 views
Skip to first unread message

david.m...@gmail.com

unread,
Jan 23, 2026, 11:49:10 PM (10 days ago) Jan 23
to Window Maker Development
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 <X11/Xlib.h>
 #include <X11/Xatom.h>
+#include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <WINGs/WUtil.h>
 #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)
--
2.43.0
0001-wmaker-set-the-window-manager-s-information.patch

david.m...@gmail.com

unread,
Jan 26, 2026, 7:58:59 AM (8 days ago) Jan 26
to Window Maker Development
Found out that line:

+ XChangeProperty(dpy, scr->info_window, net_wm_name, utf8_string, 8,
+ PropModeReplace, (unsigned char *)wm_name, strlen(wm_name));

is breaking xterm weirdly, input of the main window is hidden and output is displayed inside the appicon.
I am investigating it.

david.m...@gmail.com

unread,
Jan 26, 2026, 3:33:47 PM (7 days ago) Jan 26
to Window Maker Development
ok I found the issue, xterm does not accept a space in the window manager's name...
Carlos, not sure if you want to merge that patch with the previous commit as it's just 1 line difference.


xterm is not working properly (it's not advertising its internal icon)
if the window manager's name contains a space, seems to be specific
to xterm as xeyes and xpaint are working fine.
---
 src/wmspec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wmspec.c b/src/wmspec.c
index fe313410..1fa01aa7 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -364,7 +364,7 @@ static void setSupportedHints(WScreen *scr)

  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);
+ snprintf(wm_name, sizeof(wm_name), "WindowMaker %s", VERSION);

  XChangeProperty(dpy, scr->info_window, net_wm_name, utf8_string, 8,
  PropModeReplace, (unsigned char *)wm_name, strlen(wm_name));
 
--
2.43.0


0001-wmaker-fix-_NET_WM_NAME-window-manager-s-name.patch
Reply all
Reply to author
Forward
0 new messages