diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-12-07 23:19:52 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-12-07 23:19:52 +0000 |
commit | 833470ed20347a2d534ed1a02c578ffa97d78553 (patch) | |
tree | 3bcf6e4dcc66cf73a4729c1cb46fa982d85f3db6 | |
parent | 62b54fdd3736ddf351d8a423c662954bc754e916 (diff) |
Implement _NET_NUMBER_OF_DESKTOPS, currently this is statically 9 and
unchangable. the group code needs some cleaning up before this will be a
bit less hackish.
ok okan@
-rw-r--r-- | app/cwm/calmwm.c | 11 | ||||
-rw-r--r-- | app/cwm/calmwm.h | 6 | ||||
-rw-r--r-- | app/cwm/group.c | 4 | ||||
-rw-r--r-- | app/cwm/xutil.c | 3 |
4 files changed, 16 insertions, 8 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index 7431a8979..419b960cb 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.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: calmwm.c,v 1.44 2009/12/07 21:20:52 okan Exp $ + * $Id: calmwm.c,v 1.45 2009/12/07 23:19:51 oga Exp $ */ #include "headers.h" @@ -147,7 +147,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which) XWindowAttributes winattr; XSetWindowAttributes rootattr; int fake; - u_int nwins, i; + u_int ndesks = CALMWM_NGROUPS, nwins, i; Curscreen = sc; @@ -166,6 +166,13 @@ x_setupscreen(struct screen_ctx *sc, u_int which) /* Initialize menu window. */ menu_init(sc); + /* + * XXX this probably should be somewhere else, but since it's a + * static value for now it does ok. + */ + XChangeProperty(X_Dpy, sc->rootwin, _NET_NUMBER_OF_DESKTOPS, + XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&ndesks, 1); + xu_setwmname(sc); /* Deal with existing clients. */ diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index cc9d0899c..60d8a5283 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -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: calmwm.h,v 1.101 2009/12/07 22:46:15 oga Exp $ + * $Id: calmwm.h,v 1.102 2009/12/07 23:19:51 oga Exp $ */ #ifndef _CALMWM_H_ @@ -159,6 +159,7 @@ TAILQ_HEAD(client_ctx_q, client_ctx); extern const char *shortcut_to_name[]; +#define CALMWM_NGROUPS 9 struct group_ctx { TAILQ_ENTRY(group_ctx) entry; struct client_ctx_q clients; @@ -528,7 +529,8 @@ extern struct conf Conf; #define _NET_WM_NAME cwm_atoms[9] #define _NET_ACTIVE_WINDOW cwm_atoms[10] #define _NET_CLIENT_LIST cwm_atoms[11] -#define CWM_NO_ATOMS 12 +#define _NET_NUMBER_OF_DESKTOPS cwm_atoms[12] +#define CWM_NO_ATOMS 13 #define CWM_NETWM_START 7 extern Atom cwm_atoms[CWM_NO_ATOMS]; diff --git a/app/cwm/group.c b/app/cwm/group.c index ef6340984..5409dcb6d 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,14 +16,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: group.c,v 1.32 2009/06/20 00:55:42 okan Exp $ + * $Id: group.c,v 1.33 2009/12/07 23:19:51 oga Exp $ */ #include "headers.h" #include "calmwm.h" -#define CALMWM_NGROUPS 9 - static void group_add(struct group_ctx *, struct client_ctx *); static void group_remove(struct client_ctx *); static void group_hide(struct group_ctx *); diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c index e1577dd7f..6b3d95b31 100644 --- a/app/cwm/xutil.c +++ b/app/cwm/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.20 2009/12/07 22:46:15 oga Exp $ + * $Id: xutil.c,v 1.21 2009/12/07 23:19:51 oga Exp $ */ #include "headers.h" @@ -183,6 +183,7 @@ char *atoms[CWM_NO_ATOMS] = { "_NET_WM_NAME", "_NET_ACTIVE_WINDOW", "_NET_CLIENT_LIST", + "_NET_NUMBER_OF_DESKTOPS", }; void |