summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-02-08 02:49:30 +0000
committerokan <okan>2014-02-08 02:49:30 +0000
commit6798e3dde302febeef3aa641eadea55d394461ff (patch)
treed35f001914938690009c4d5b61a032803f966e90
parent1208225fbde43db8858e4d0c26ac6bac6f27166d (diff)
parent5fa1a970345160a2cdd15460c6435446e8ab71a3 (diff)
downloadcwm-6798e3dde302febeef3aa641eadea55d394461ff.tar.gz
cwm-6798e3dde302febeef3aa641eadea55d394461ff.tar.xz
cwm-6798e3dde302febeef3aa641eadea55d394461ff.zip
Make sure we cycle through existing client's group membership and set
the hidden state on the group; important to know group hidden state
after a re-exec or restart of cwm (as easily seen in group menu).
-rw-r--r--calmwm.h1
-rw-r--r--group.c9
-rw-r--r--screen.c1
3 files changed, 11 insertions, 0 deletions
diff --git a/calmwm.h b/calmwm.h
index d524ea9..be0a08c 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -415,6 +415,7 @@ void			 group_init(struct screen_ctx *);
 void			 group_menu(struct screen_ctx *);
 void			 group_movetogroup(struct client_ctx *, int);
 void			 group_only(struct screen_ctx *, int);
+void			 group_set_state(struct screen_ctx *);
 void			 group_sticky(struct client_ctx *);
 void			 group_sticky_toggle_enter(struct client_ctx *);
 void			 group_sticky_toggle_exit(struct client_ctx *);
diff --git a/group.c b/group.c
index 0505934..8552055 100644
--- a/group.c
+++ b/group.c
@@ -148,6 +148,15 @@ group_init(struct screen_ctx *sc)
 	group_setactive(sc, 1);
 }
 
+void
+group_set_state(struct screen_ctx *sc)
+{
+	struct group_ctx	*gc;
+
+	TAILQ_FOREACH(gc, &sc->groupq, entry)
+		group_fix_hidden_state(gc);
+}
+
 static void
 group_setactive(struct screen_ctx *sc, long idx)
 {
diff --git a/screen.c b/screen.c
index 17d6b87..993e4fc 100644
--- a/screen.c
+++ b/screen.c
@@ -69,6 +69,7 @@ screen_init(int which)
 		XFree(wins);
 	}
 	screen_updatestackingorder(sc);
+	group_set_state(sc);
 
 	if (HasRandr)
 		XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);