aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2014-09-23 14:25:08 +0000
committerokan2014-09-23 14:25:08 +0000
commit67bc0ac5f4529aa91e615a0bccb42424ff432926 (patch)
treece33ee89b616fbbf14ec406251776ba364da8dbb
parentca567c515e829d14facdedce8e5ca147a21d013c (diff)
downloadcwm-67bc0ac5f4529aa91e615a0bccb42424ff432926.tar.gz
Update _NET_CURRENT_DESKTOP with the screen's group_active->num.
-rw-r--r--calmwm.h4
-rw-r--r--group.c8
-rw-r--r--xutil.c8
3 files changed, 11 insertions, 9 deletions
diff --git a/calmwm.h b/calmwm.h
index 6fe53ec..b3a969f 100644
--- a/calmwm.h
+++ b/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.
*
- * $OpenBSD: calmwm.h,v 1.280 2014/09/23 13:45:48 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.281 2014/09/23 14:25:08 okan Exp $
*/
#ifndef _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 b697403..ff9b339 100644
--- a/group.c
+++ b/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.105 2014/09/23 13:45:48 okan Exp $
+ * $OpenBSD: group.c,v 1.106 2014/09/23 14:25:08 okan Exp $
*/
#include <sys/param.h>
@@ -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 fe1d535..26188af 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.
*
- * $OpenBSD: xutil.c,v 1.95 2014/09/17 18:41:44 okan Exp $
+ * $OpenBSD: xutil.c,v 1.96 2014/09/23 14:25:08 okan Exp $
*/
#include <sys/param.h>
@@ -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