mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Mechanical change: group->gc
This commit is contained in:
parent
f467838e7b
commit
28d4001eca
2
calmwm.h
2
calmwm.h
@ -147,6 +147,7 @@ struct client_ctx {
|
|||||||
TAILQ_ENTRY(client_ctx) entry;
|
TAILQ_ENTRY(client_ctx) entry;
|
||||||
TAILQ_ENTRY(client_ctx) group_entry;
|
TAILQ_ENTRY(client_ctx) group_entry;
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
|
struct group_ctx *gc;
|
||||||
Window win;
|
Window win;
|
||||||
Colormap colormap;
|
Colormap colormap;
|
||||||
unsigned int bwidth; /* border width */
|
unsigned int bwidth; /* border width */
|
||||||
@ -198,7 +199,6 @@ struct client_ctx {
|
|||||||
char *name;
|
char *name;
|
||||||
char *label;
|
char *label;
|
||||||
char *matchname;
|
char *matchname;
|
||||||
struct group_ctx *group;
|
|
||||||
XClassHint ch;
|
XClassHint ch;
|
||||||
XWMHints *wmh;
|
XWMHints *wmh;
|
||||||
};
|
};
|
||||||
|
14
client.c
14
client.c
@ -163,8 +163,8 @@ client_delete(struct client_ctx *cc)
|
|||||||
xu_ewmh_net_client_list(sc);
|
xu_ewmh_net_client_list(sc);
|
||||||
xu_ewmh_net_client_list_stacking(sc);
|
xu_ewmh_net_client_list_stacking(sc);
|
||||||
|
|
||||||
if (cc->group != NULL)
|
if (cc->gc != NULL)
|
||||||
TAILQ_REMOVE(&cc->group->clientq, cc, group_entry);
|
TAILQ_REMOVE(&cc->gc->clientq, cc, group_entry);
|
||||||
|
|
||||||
if (cc == client_current())
|
if (cc == client_current())
|
||||||
client_none(sc);
|
client_none(sc);
|
||||||
@ -682,7 +682,7 @@ client_cycle(struct screen_ctx *sc, int flags)
|
|||||||
/* Only cycle visible and non-ignored windows. */
|
/* Only cycle visible and non-ignored windows. */
|
||||||
if ((newcc->flags & (CLIENT_HIDDEN | CLIENT_IGNORE))
|
if ((newcc->flags & (CLIENT_HIDDEN | CLIENT_IGNORE))
|
||||||
|| ((flags & CWM_INGROUP) &&
|
|| ((flags & CWM_INGROUP) &&
|
||||||
(newcc->group != oldcc->group)))
|
(newcc->gc != oldcc->gc)))
|
||||||
again = 1;
|
again = 1;
|
||||||
|
|
||||||
/* Is oldcc the only non-hidden window? */
|
/* Is oldcc the only non-hidden window? */
|
||||||
@ -915,8 +915,8 @@ client_transient(struct client_ctx *cc)
|
|||||||
Window trans;
|
Window trans;
|
||||||
|
|
||||||
if (XGetTransientForHint(X_Dpy, cc->win, &trans)) {
|
if (XGetTransientForHint(X_Dpy, cc->win, &trans)) {
|
||||||
if ((tc = client_find(trans)) != NULL && tc->group) {
|
if ((tc = client_find(trans)) != NULL && tc->gc) {
|
||||||
group_movetogroup(cc, tc->group->num);
|
group_movetogroup(cc, tc->gc->num);
|
||||||
if (tc->flags & CLIENT_IGNORE)
|
if (tc->flags & CLIENT_IGNORE)
|
||||||
cc->flags |= CLIENT_IGNORE;
|
cc->flags |= CLIENT_IGNORE;
|
||||||
}
|
}
|
||||||
@ -961,7 +961,7 @@ void
|
|||||||
client_htile(struct client_ctx *cc)
|
client_htile(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct client_ctx *ci;
|
struct client_ctx *ci;
|
||||||
struct group_ctx *gc = cc->group;
|
struct group_ctx *gc = cc->gc;
|
||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
struct geom area;
|
struct geom area;
|
||||||
int i, n, mh, x, h, w;
|
int i, n, mh, x, h, w;
|
||||||
@ -1020,7 +1020,7 @@ void
|
|||||||
client_vtile(struct client_ctx *cc)
|
client_vtile(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct client_ctx *ci;
|
struct client_ctx *ci;
|
||||||
struct group_ctx *gc = cc->group;
|
struct group_ctx *gc = cc->gc;
|
||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
struct geom area;
|
struct geom area;
|
||||||
int i, n, mw, y, h, w;
|
int i, n, mw, y, h, w;
|
||||||
|
12
group.c
12
group.c
@ -45,15 +45,15 @@ const char *num_to_name[] = {
|
|||||||
void
|
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->gc != NULL)
|
||||||
TAILQ_REMOVE(&cc->group->clientq, cc, group_entry);
|
TAILQ_REMOVE(&cc->gc->clientq, cc, group_entry);
|
||||||
|
|
||||||
if ((gc != NULL) && (gc->num == 0))
|
if ((gc != NULL) && (gc->num == 0))
|
||||||
gc = NULL;
|
gc = NULL;
|
||||||
|
|
||||||
cc->group = gc;
|
cc->gc = gc;
|
||||||
|
|
||||||
if (cc->group != NULL)
|
if (cc->gc != NULL)
|
||||||
TAILQ_INSERT_TAIL(&gc->clientq, cc, group_entry);
|
TAILQ_INSERT_TAIL(&gc->clientq, cc, group_entry);
|
||||||
|
|
||||||
xu_ewmh_net_wm_desktop(cc);
|
xu_ewmh_net_wm_desktop(cc);
|
||||||
@ -162,7 +162,7 @@ group_movetogroup(struct client_ctx *cc, int idx)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->group == gc)
|
if (cc->gc == gc)
|
||||||
return;
|
return;
|
||||||
if (group_holds_only_hidden(gc))
|
if (group_holds_only_hidden(gc))
|
||||||
client_hide(cc);
|
client_hide(cc);
|
||||||
@ -175,7 +175,7 @@ group_toggle_membership_enter(struct client_ctx *cc)
|
|||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
struct group_ctx *gc = sc->group_active;
|
struct group_ctx *gc = sc->group_active;
|
||||||
|
|
||||||
if (gc == cc->group) {
|
if (gc == cc->gc) {
|
||||||
group_assign(NULL, cc);
|
group_assign(NULL, cc);
|
||||||
cc->flags |= CLIENT_UNGROUP;
|
cc->flags |= CLIENT_UNGROUP;
|
||||||
} else {
|
} else {
|
||||||
|
2
search.c
2
search.c
@ -156,7 +156,7 @@ search_print_client(struct menu *mi, int list)
|
|||||||
cc->matchname = cc->name;
|
cc->matchname = cc->name;
|
||||||
|
|
||||||
(void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s",
|
(void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s",
|
||||||
(cc->group) ? cc->group->num : 0, flag,
|
(cc->gc) ? cc->gc->num : 0, flag,
|
||||||
(cc->label) ? cc->label : "", cc->matchname);
|
(cc->label) ? cc->label : "", cc->matchname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
xutil.c
4
xutil.c
@ -362,8 +362,8 @@ xu_ewmh_net_wm_desktop(struct client_ctx *cc)
|
|||||||
{
|
{
|
||||||
long num = 0xffffffff;
|
long num = 0xffffffff;
|
||||||
|
|
||||||
if (cc->group)
|
if (cc->gc)
|
||||||
num = cc->group->num;
|
num = cc->gc->num;
|
||||||
|
|
||||||
XChangeProperty(X_Dpy, cc->win, ewmh[_NET_WM_DESKTOP],
|
XChangeProperty(X_Dpy, cc->win, ewmh[_NET_WM_DESKTOP],
|
||||||
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&num, 1);
|
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&num, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user