From 2abc1ac242714f03d4a112e198e8b458efbbb777 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Mon, 9 Jul 2012 22:37:45 +0300 Subject: call tile only when there are clients to tile this is actually also checked in tile function --- monsterwm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'monsterwm.c') diff --git a/monsterwm.c b/monsterwm.c index 43e17df..47001ed 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -215,12 +215,11 @@ void buttonpress(XEvent *e) { void change_desktop(const Arg *arg) { if (arg->i == currdeskidx) return; Desktop *d = &desktops[currdeskidx], *n = &desktops[(currdeskidx = arg->i)]; - if (n->head) tile(n); if (n->curr) XMapWindow(dis, n->curr->win); for (Client *c = n->head; c; c = c->next) XMapWindow(dis, c->win); for (Client *c = d->head; c; c = c->next) if (c != d->curr) XUnmapWindow(dis, c->win); if (d->curr) XUnmapWindow(dis, d->curr->win); - if (n->curr) focus(n->curr, n); + if (n->head) { tile(n); focus(n->curr, n); } desktopinfo(); } @@ -277,7 +276,7 @@ void clientmessage(XEvent *e) { (unsigned)e->xclient.data.l[1] == netatoms[NET_FULLSCREEN] || (unsigned)e->xclient.data.l[2] == netatoms[NET_FULLSCREEN])) { setfullscreen(c, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfull))); - if (d->head) tile(d); + if (!(c->isfloat || c->istrans) || !d->head->next) tile(d); } else if (e->xclient.message_type == netatoms[NET_ACTIVE]) focus(c, d); } @@ -865,8 +864,7 @@ void switch_mode(const Arg *arg) { for (Client *c = d->head; c; c = c->next) c->isfloat = False; if ((d->mode = arg->i) == FLOAT) for (Client *c = d->head; c; c = c->next) c->isfloat = True; - tile(d); - focus(d->curr, d); + if (d->head) { tile(d); focus(d->curr, d); } desktopinfo(); } -- cgit v1.3.1