name the group client queue appropriately, like other queues

This commit is contained in:
okan 2014-09-08 21:15:14 +00:00
parent 85b6a48da7
commit 57ff8d4658
4 changed files with 21 additions and 21 deletions

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* $OpenBSD: calmwm.h,v 1.273 2014/09/08 20:11:22 okan Exp $ * $OpenBSD: calmwm.h,v 1.274 2014/09/08 21:15:14 okan Exp $
*/ */
#ifndef _CALMWM_H_ #ifndef _CALMWM_H_
@ -202,7 +202,7 @@ TAILQ_HEAD(client_ctx_q, client_ctx);
struct group_ctx { struct group_ctx {
TAILQ_ENTRY(group_ctx) entry; TAILQ_ENTRY(group_ctx) entry;
struct screen_ctx *sc; struct screen_ctx *sc;
struct client_ctx_q clients; struct client_ctx_q clientq;
char *name; char *name;
int num; int num;
}; };

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* $OpenBSD: client.c,v 1.179 2014/09/08 20:37:02 okan Exp $ * $OpenBSD: client.c,v 1.180 2014/09/08 21:15:14 okan Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -154,7 +154,7 @@ client_delete(struct client_ctx *cc)
xu_ewmh_net_client_list(sc); xu_ewmh_net_client_list(sc);
if (cc->group != NULL) if (cc->group != NULL)
TAILQ_REMOVE(&cc->group->clients, cc, group_entry); TAILQ_REMOVE(&cc->group->clientq, cc, group_entry);
if (cc == client_current()) if (cc == client_current())
client_none(sc); client_none(sc);
@ -943,7 +943,7 @@ client_htile(struct client_ctx *cc)
return; return;
i = n = 0; i = n = 0;
TAILQ_FOREACH(ci, &gc->clients, group_entry) { TAILQ_FOREACH(ci, &gc->clientq, group_entry) {
if (ci->flags & CLIENT_HIDDEN || if (ci->flags & CLIENT_HIDDEN ||
ci->flags & CLIENT_IGNORE || (ci == cc)) ci->flags & CLIENT_IGNORE || (ci == cc))
continue; continue;
@ -971,7 +971,7 @@ client_htile(struct client_ctx *cc)
x = xine.x; x = xine.x;
w = xine.w / n; w = xine.w / n;
h = xine.h - mh; h = xine.h - mh;
TAILQ_FOREACH(ci, &gc->clients, group_entry) { TAILQ_FOREACH(ci, &gc->clientq, group_entry) {
if (ci->flags & CLIENT_HIDDEN || if (ci->flags & CLIENT_HIDDEN ||
ci->flags & CLIENT_IGNORE || (ci == cc)) ci->flags & CLIENT_IGNORE || (ci == cc))
continue; continue;
@ -1002,7 +1002,7 @@ client_vtile(struct client_ctx *cc)
return; return;
i = n = 0; i = n = 0;
TAILQ_FOREACH(ci, &gc->clients, group_entry) { TAILQ_FOREACH(ci, &gc->clientq, group_entry) {
if (ci->flags & CLIENT_HIDDEN || if (ci->flags & CLIENT_HIDDEN ||
ci->flags & CLIENT_IGNORE || (ci == cc)) ci->flags & CLIENT_IGNORE || (ci == cc))
continue; continue;
@ -1030,7 +1030,7 @@ client_vtile(struct client_ctx *cc)
y = xine.y; y = xine.y;
h = xine.h / n; h = xine.h / n;
w = xine.w - mw; w = xine.w - mw;
TAILQ_FOREACH(ci, &gc->clients, group_entry) { TAILQ_FOREACH(ci, &gc->clientq, group_entry) {
if (ci->flags & CLIENT_HIDDEN || if (ci->flags & CLIENT_HIDDEN ||
ci->flags & CLIENT_IGNORE || (ci == cc)) ci->flags & CLIENT_IGNORE || (ci == cc))
continue; continue;

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* $OpenBSD: group.c,v 1.101 2014/09/08 13:51:29 okan Exp $ * $OpenBSD: group.c,v 1.102 2014/09/08 21:15:14 okan Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -45,12 +45,12 @@ static void
group_assign(struct group_ctx *gc, struct client_ctx *cc) group_assign(struct group_ctx *gc, struct client_ctx *cc)
{ {
if (cc->group != NULL) if (cc->group != NULL)
TAILQ_REMOVE(&cc->group->clients, cc, group_entry); TAILQ_REMOVE(&cc->group->clientq, cc, group_entry);
cc->group = gc; cc->group = gc;
if (cc->group != NULL) if (cc->group != NULL)
TAILQ_INSERT_TAIL(&gc->clients, cc, group_entry); TAILQ_INSERT_TAIL(&gc->clientq, cc, group_entry);
xu_ewmh_net_wm_desktop(cc); xu_ewmh_net_wm_desktop(cc);
} }
@ -62,7 +62,7 @@ group_hide(struct group_ctx *gc)
screen_updatestackingorder(gc->sc); screen_updatestackingorder(gc->sc);
TAILQ_FOREACH(cc, &gc->clients, group_entry) TAILQ_FOREACH(cc, &gc->clientq, group_entry)
client_hide(cc); client_hide(cc);
} }
@ -71,7 +71,7 @@ group_show(struct group_ctx *gc)
{ {
struct client_ctx *cc; struct client_ctx *cc;
TAILQ_FOREACH(cc, &gc->clients, group_entry) TAILQ_FOREACH(cc, &gc->clientq, group_entry)
client_unhide(cc); client_unhide(cc);
group_restack(gc); group_restack(gc);
@ -86,14 +86,14 @@ group_restack(struct group_ctx *gc)
int i, lastempty = -1; int i, lastempty = -1;
int nwins = 0, highstack = 0; int nwins = 0, highstack = 0;
TAILQ_FOREACH(cc, &gc->clients, group_entry) { TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
if (cc->stackingorder > highstack) if (cc->stackingorder > highstack)
highstack = cc->stackingorder; highstack = cc->stackingorder;
} }
winlist = xcalloc((highstack + 1), sizeof(*winlist)); winlist = xcalloc((highstack + 1), sizeof(*winlist));
/* Invert the stacking order for XRestackWindows(). */ /* Invert the stacking order for XRestackWindows(). */
TAILQ_FOREACH(cc, &gc->clients, group_entry) { TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
winlist[highstack - cc->stackingorder] = cc->win; winlist[highstack - cc->stackingorder] = cc->win;
nwins++; nwins++;
} }
@ -125,7 +125,7 @@ group_init(struct screen_ctx *sc)
for (i = 0; i < CALMWM_NGROUPS; i++) { for (i = 0; i < CALMWM_NGROUPS; i++) {
gc = xcalloc(1, sizeof(*gc)); gc = xcalloc(1, sizeof(*gc));
gc->sc = sc; gc->sc = sc;
TAILQ_INIT(&gc->clients); TAILQ_INIT(&gc->clientq);
gc->name = xstrdup(num_to_name[i]); gc->name = xstrdup(num_to_name[i]);
gc->num = i; gc->num = i;
TAILQ_INSERT_TAIL(&sc->groupq, gc, entry); TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
@ -211,7 +211,7 @@ group_hidden_state(struct group_ctx *gc)
struct client_ctx *cc; struct client_ctx *cc;
int hidden = 0, same = 0; int hidden = 0, same = 0;
TAILQ_FOREACH(cc, &gc->clients, group_entry) { TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
if (cc->flags & CLIENT_STICKY) if (cc->flags & CLIENT_STICKY)
continue; continue;
if (hidden == ((cc->flags & CLIENT_HIDDEN) ? 1 : 0)) if (hidden == ((cc->flags & CLIENT_HIDDEN) ? 1 : 0))
@ -242,7 +242,7 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
else { else {
group_hide(gc); group_hide(gc);
/* make clients stick to empty group */ /* make clients stick to empty group */
if (TAILQ_EMPTY(&gc->clients)) if (TAILQ_EMPTY(&gc->clientq))
group_setactive(sc, idx); group_setactive(sc, idx);
} }
} }
@ -283,7 +283,7 @@ group_cycle(struct screen_ctx *sc, int flags)
if (gc == sc->group_active) if (gc == sc->group_active)
break; break;
if (!TAILQ_EMPTY(&gc->clients) && showgroup == NULL) if (!TAILQ_EMPTY(&gc->clientq) && showgroup == NULL)
showgroup = gc; showgroup = gc;
else if (!group_hidden_state(gc)) else if (!group_hidden_state(gc))
group_hide(gc); group_hide(gc);

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* $OpenBSD: mousefunc.c,v 1.79 2014/09/08 20:11:22 okan Exp $ * $OpenBSD: mousefunc.c,v 1.80 2014/09/08 21:15:14 okan Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -188,7 +188,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg)
TAILQ_INIT(&menuq); TAILQ_INIT(&menuq);
TAILQ_FOREACH(gc, &sc->groupq, entry) { TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (TAILQ_EMPTY(&gc->clients)) if (TAILQ_EMPTY(&gc->clientq))
continue; continue;
menuq_add(&menuq, gc, menuq_add(&menuq, gc,
group_hidden_state(gc) ? "%d: [%s]" : "%d: %s", group_hidden_state(gc) ? "%d: [%s]" : "%d: %s",