mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag
instead of relying on curcc.
This commit is contained in:
parent
9124a561e3
commit
b8933ebcca
12
client.c
12
client.c
@ -176,12 +176,12 @@ 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->flags & CLIENT_ACTIVE)
|
||||||
|
client_none(sc);
|
||||||
|
|
||||||
if (cc->gc != NULL)
|
if (cc->gc != NULL)
|
||||||
TAILQ_REMOVE(&cc->gc->clientq, cc, group_entry);
|
TAILQ_REMOVE(&cc->gc->clientq, cc, group_entry);
|
||||||
|
|
||||||
if (cc == client_current())
|
|
||||||
client_none(sc);
|
|
||||||
|
|
||||||
while ((wn = TAILQ_FIRST(&cc->nameq)) != NULL) {
|
while ((wn = TAILQ_FIRST(&cc->nameq)) != NULL) {
|
||||||
TAILQ_REMOVE(&cc->nameq, wn, entry);
|
TAILQ_REMOVE(&cc->nameq, wn, entry);
|
||||||
free(wn->name);
|
free(wn->name);
|
||||||
@ -510,12 +510,12 @@ client_hide(struct client_ctx *cc)
|
|||||||
{
|
{
|
||||||
XUnmapWindow(X_Dpy, cc->win);
|
XUnmapWindow(X_Dpy, cc->win);
|
||||||
|
|
||||||
|
if (cc->flags & CLIENT_ACTIVE)
|
||||||
|
client_none(cc->sc);
|
||||||
|
|
||||||
cc->flags &= ~CLIENT_ACTIVE;
|
cc->flags &= ~CLIENT_ACTIVE;
|
||||||
cc->flags |= CLIENT_HIDDEN;
|
cc->flags |= CLIENT_HIDDEN;
|
||||||
client_set_wm_state(cc, IconicState);
|
client_set_wm_state(cc, IconicState);
|
||||||
|
|
||||||
if (cc == client_current())
|
|
||||||
client_none(cc->sc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
4
search.c
4
search.c
@ -94,7 +94,7 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
|||||||
* window. Furthermore, this is denoted by a "!" when
|
* window. Furthermore, this is denoted by a "!" when
|
||||||
* printing the window name in the search menu.
|
* printing the window name in the search menu.
|
||||||
*/
|
*/
|
||||||
if (cc == client_current() && tier < nitems(tierp) - 1)
|
if ((cc->flags & CLIENT_ACTIVE) && (tier < nitems(tierp) - 1))
|
||||||
tier++;
|
tier++;
|
||||||
|
|
||||||
/* Clients that are hidden get ranked one up. */
|
/* Clients that are hidden get ranked one up. */
|
||||||
@ -147,7 +147,7 @@ search_print_client(struct menu *mi, int list)
|
|||||||
struct client_ctx *cc = (struct client_ctx *)mi->ctx;
|
struct client_ctx *cc = (struct client_ctx *)mi->ctx;
|
||||||
char flag = ' ';
|
char flag = ' ';
|
||||||
|
|
||||||
if (cc == client_current())
|
if (cc->flags & CLIENT_ACTIVE)
|
||||||
flag = '!';
|
flag = '!';
|
||||||
else if (cc->flags & CLIENT_HIDDEN)
|
else if (cc->flags & CLIENT_HIDDEN)
|
||||||
flag = '&';
|
flag = '&';
|
||||||
|
@ -250,10 +250,13 @@ xev_handle_buttonpress(XEvent *ee)
|
|||||||
static void
|
static void
|
||||||
xev_handle_buttonrelease(XEvent *ee)
|
xev_handle_buttonrelease(XEvent *ee)
|
||||||
{
|
{
|
||||||
|
XButtonEvent *e = &ee->xbutton;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
if ((cc = client_current()) != NULL)
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
|
if (cc->flags & CLIENT_ACTIVE)
|
||||||
group_toggle_membership_leave(cc);
|
group_toggle_membership_leave(cc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user