aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2015-08-25 20:35:49 +0000
committerokan2015-08-25 20:35:49 +0000
commit87bcfe8451984d9c17a92519a97638fdcbb2550b (patch)
tree71a1cedcee3a84fbdddd6adc862330b9bb431f0b /group.c
parent06107b8a571dbdb637ce94319455ef62254009f5 (diff)
downloadcwm-87bcfe8451984d9c17a92519a97638fdcbb2550b.tar.gz
Further simplify _NET_WM_DESKTOP handling using new group_assign().
Diffstat (limited to 'group.c')
-rw-r--r--group.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/group.c b/group.c
index 6e2b7a4..929ad4f 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.117 2015/08/25 19:52:02 okan Exp $
+ * $OpenBSD: group.c,v 1.118 2015/08/25 20:35:49 okan Exp $
*/
#include <sys/types.h>
@@ -331,20 +331,17 @@ group_restore(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct group_ctx *gc;
- int num = -1;
+ int num;
long *grpnum;
if (xu_getprop(cc->win, ewmh[_NET_WM_DESKTOP], XA_CARDINAL, 1L,
(unsigned char **)&grpnum) <= 0)
return(0);
- num = MIN(*grpnum, (CALMWM_NGROUPS - 1));
+ num = (*grpnum == -1) ? 0 : *grpnum;
+ num = MIN(num, (CALMWM_NGROUPS - 1));
XFree(grpnum);
- if (num == -1) {
- group_assign(NULL, cc);
- return(1);
- }
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == num) {
group_assign(gc, cc);