aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2009-12-07 21:20:52 +0000
committerokan2009-12-07 21:20:52 +0000
commite4020287e35b326e95d08d540f8c14b34d9c32be (patch)
tree0a9328dc1b84182f56ea5f72e6d2b45d128fcc2c /xutil.c
parentc88913a1665e6a67ca9af2d168494a3ff8877294 (diff)
downloadcwm-e4020287e35b326e95d08d540f8c14b34d9c32be.tar.gz
introduce the beginnings of netwm support, minimally and correctly;
allows java to be happy, but additionally stops others from whinning about a non-netwm complaint wm. more to come. written a few times; this one includes a clever hack from oga@ to populate _NET_SUPPORTED. ok oga@
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/xutil.c b/xutil.c
index 551075e..5bea7c3 100644
--- a/xutil.c
+++ b/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: xutil.c,v 1.17 2009/06/26 12:21:58 okan Exp $
+ * $Id: xutil.c,v 1.18 2009/12/07 21:20:52 okan Exp $
*/
#include "headers.h"
@@ -177,6 +177,10 @@ char *atoms[CWM_NO_ATOMS] = {
"WM_PROTOCOLS",
"_MOTIF_WM_HINTS",
"_CWM_GRP",
+ "UTF8_STRING",
+ "_NET_SUPPORTED",
+ "_NET_SUPPORTING_WM_CHECK",
+ "_NET_WM_NAME",
};
void
@@ -185,6 +189,31 @@ xu_getatoms(void)
XInternAtoms(X_Dpy, atoms, CWM_NO_ATOMS, False, cwm_atoms);
}
+void
+xu_setwmname(struct screen_ctx *sc)
+{
+ /*
+ * set up the _NET_SUPPORTED hint with all netwm atoms that we
+ * know about.
+ */
+ XChangeProperty(X_Dpy, sc->rootwin, _NET_SUPPORTED, XA_ATOM, 32,
+ PropModeReplace, (unsigned char *)&_NET_SUPPORTED,
+ CWM_NO_ATOMS - CWM_NETWM_START);
+ /*
+ * netwm spec says that to prove that the hint is not stale you must
+ * provide _NET_SUPPORTING_WM_CHECK containing a window (we use the
+ * menu window). The property must be set on the root window and the
+ * window itself, the window also must have _NET_WM_NAME set with the
+ * window manager name.
+ */
+ XChangeProperty(X_Dpy, sc->rootwin, _NET_SUPPORTING_WM_CHECK,
+ XA_WINDOW, 32, PropModeReplace, (unsigned char *)&sc->menuwin, 1);
+ XChangeProperty(X_Dpy, sc->menuwin, _NET_SUPPORTING_WM_CHECK,
+ XA_WINDOW, 32, PropModeReplace, (unsigned char *)&sc->menuwin, 1);
+ XChangeProperty(X_Dpy, sc->menuwin, _NET_WM_NAME, UTF8_STRING,
+ 8, PropModeReplace, WMNAME, strlen(WMNAME));
+}
+
unsigned long
xu_getcolor(struct screen_ctx *sc, char *name)
{