mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-21 02:43:32 +01:00
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
This commit is contained in:
committed by
Carlos R. Mafra
parent
95c68fe26d
commit
c82e6dad5c
24
src/wmspec.c
24
src/wmspec.c
@@ -32,7 +32,9 @@
|
|||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
#include "WindowMaker.h"
|
#include "WindowMaker.h"
|
||||||
@@ -274,6 +276,9 @@ static void setSupportedHints(WScreen *scr)
|
|||||||
{
|
{
|
||||||
Atom atom[wlengthof(atomNames)];
|
Atom atom[wlengthof(atomNames)];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
long pid = 0;
|
||||||
|
char wm_name[64] = "";
|
||||||
|
XClassHint *class_hint;
|
||||||
|
|
||||||
/* set supported hints list */
|
/* set supported hints list */
|
||||||
/* XXX: extend this !!! */
|
/* XXX: extend this !!! */
|
||||||
@@ -357,6 +362,25 @@ static void setSupportedHints(WScreen *scr)
|
|||||||
|
|
||||||
XChangeProperty(dpy, scr->info_window, net_supporting_wm_check, XA_WINDOW,
|
XChangeProperty(dpy, scr->info_window, net_supporting_wm_check, XA_WINDOW,
|
||||||
32, PropModeReplace, (unsigned char *)&scr->info_window, 1);
|
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)
|
void wNETWMUpdateDesktop(WScreen *scr)
|
||||||
|
|||||||
Reference in New Issue
Block a user