summary refs log tree commit diff
diff options
context:
space:
mode:
authoroga <oga>2009-12-11 18:09:16 +0000
committeroga <oga>2009-12-11 18:09:16 +0000
commit3b87bdb04759237cc4dbdca600854d1f95659fff (patch)
tree16334055e05b20580e13a051a841b5534315bb5a
parent28e94b2fbcb7ca75059a9334ab9f0bcfac3787a0 (diff)
downloadcwm-3b87bdb04759237cc4dbdca600854d1f95659fff.tar.gz
cwm-3b87bdb04759237cc4dbdca600854d1f95659fff.tar.xz
cwm-3b87bdb04759237cc4dbdca600854d1f95659fff.zip
add _NET_WORKAREA. for now we ignore the gap, this'll change soonish.
ok okan@
-rw-r--r--calmwm.h3
-rw-r--r--screen.c15
-rw-r--r--xutil.c1
3 files changed, 17 insertions, 2 deletions
diff --git a/calmwm.h b/calmwm.h
index 3405a5f..fed9051 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -542,7 +542,8 @@ extern struct conf			 Conf;
 #define	_NET_SHOWING_DESKTOP		 cwm_atoms[17]
 #define	_NET_DESKTOP_NAMES		 cwm_atoms[18]
 #define _NET_WM_DESKTOP			 cwm_atoms[19]
-#define CWM_NO_ATOMS			 20
+#define	_NET_WORKAREA			 cwm_atoms[20]
+#define CWM_NO_ATOMS			 21
 #define CWM_NETWM_START			 7
 
 extern Atom				 cwm_atoms[CWM_NO_ATOMS];
diff --git a/screen.c b/screen.c
index 02fea44..3610bf7 100644
--- a/screen.c
+++ b/screen.c
@@ -102,10 +102,23 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y)
 void
 screen_update_geometry(struct screen_ctx *sc, int width, int height)
 {
-	long	geom[2];
+	long	 geom[2], workareas[CALMWM_NGROUPS][4];
+	int	 i;
 
 	sc->xmax = geom[0] = width;
 	sc->ymax = geom[1] = height;
 	XChangeProperty(X_Dpy, sc->rootwin, _NET_DESKTOP_GEOMETRY,
 	    XA_CARDINAL, 32, PropModeReplace, (unsigned char *)geom , 2);
+
+	/* x, y, width, height. XXX gap */
+	for (i = 0; i < CALMWM_NGROUPS; i++) {
+		workareas[i][0] = 0;
+		workareas[i][1] = 0;
+		workareas[i][2] = width;
+		workareas[i][3] = height;
+	}
+
+	XChangeProperty(X_Dpy, sc->rootwin, _NET_WORKAREA,
+	    XA_CARDINAL, 32, PropModeReplace,
+	    (unsigned char *)workareas, CALMWM_NGROUPS * 4);
 }
diff --git a/xutil.c b/xutil.c
index 6476162..a67aa9a 100644
--- a/xutil.c
+++ b/xutil.c
@@ -191,6 +191,7 @@ char 		*atoms[CWM_NO_ATOMS] = {
 	"_NET_SHOWING_DESKTOP",
 	"_NET_DESKTOP_NAMES",
 	"_NET_WM_DESKTOP",
+	"_NET_WORKAREA",
 };
 
 void