summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-09-23 14:25:08 +0000
committerokan <okan>2014-09-23 14:25:08 +0000
commit845e82015ce9c1467f100a7f3d9c0310b00e353c (patch)
tree373418947f75ea056e8534940c16d242dec018a9
parentcb65869d7a01eb093e8a95caea5a6e21b6689f42 (diff)
downloadcwm-845e82015ce9c1467f100a7f3d9c0310b00e353c.tar.gz
cwm-845e82015ce9c1467f100a7f3d9c0310b00e353c.tar.xz
cwm-845e82015ce9c1467f100a7f3d9c0310b00e353c.zip
Update _NET_CURRENT_DESKTOP with the screen's group_active->num.
-rw-r--r--calmwm.h2
-rw-r--r--group.c6
-rw-r--r--xutil.c6
3 files changed, 8 insertions, 6 deletions
diff --git a/calmwm.h b/calmwm.h
index 03d7a85..01242ee 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -544,7 +544,7 @@ void			 xu_ewmh_net_wm_desktop_viewport(struct screen_ctx *);
 void			 xu_ewmh_net_wm_number_of_desktops(struct screen_ctx *);
 void			 xu_ewmh_net_showing_desktop(struct screen_ctx *);
 void			 xu_ewmh_net_virtual_roots(struct screen_ctx *);
-void			 xu_ewmh_net_current_desktop(struct screen_ctx *, long);
+void			 xu_ewmh_net_current_desktop(struct screen_ctx *);
 void			 xu_ewmh_net_desktop_names(struct screen_ctx *);
 
 void			 xu_ewmh_net_wm_desktop(struct client_ctx *);
diff --git a/group.c b/group.c
index 7d05861..cabf854 100644
--- a/group.c
+++ b/group.c
@@ -34,7 +34,7 @@
 
 static void		 group_assign(struct group_ctx *, struct client_ctx *);
 static void		 group_restack(struct group_ctx *);
-static void		 group_setactive(struct screen_ctx *, long);
+static void		 group_setactive(struct screen_ctx *, int);
 
 const char *num_to_name[] = {
 	"nogroup", "one", "two", "three", "four", "five", "six",
@@ -132,7 +132,7 @@ group_init(struct screen_ctx *sc)
 }
 
 static void
-group_setactive(struct screen_ctx *sc, long idx)
+group_setactive(struct screen_ctx *sc, int idx)
 {
 	struct group_ctx	*gc;
 
@@ -142,7 +142,7 @@ group_setactive(struct screen_ctx *sc, long idx)
 	}
 	sc->group_active = gc;
 
-	xu_ewmh_net_current_desktop(sc, idx);
+	xu_ewmh_net_current_desktop(sc);
 }
 
 void
diff --git a/xutil.c b/xutil.c
index 91ef51b..70186f8 100644
--- a/xutil.c
+++ b/xutil.c
@@ -274,10 +274,12 @@ xu_ewmh_net_virtual_roots(struct screen_ctx *sc)
 }
 
 void
-xu_ewmh_net_current_desktop(struct screen_ctx *sc, long idx)
+xu_ewmh_net_current_desktop(struct screen_ctx *sc)
 {
+	long	 num = sc->group_active->num;
+
 	XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_CURRENT_DESKTOP],
-	    XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&idx, 1);
+	    XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&num, 1);
 }
 
 void