mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
add helper function client_show to bring together like actions for unhide/raise
This commit is contained in:
1
calmwm.h
1
calmwm.h
@@ -412,6 +412,7 @@ void client_send_delete(struct client_ctx *);
|
|||||||
void client_set_wm_state(struct client_ctx *, long);
|
void client_set_wm_state(struct client_ctx *, long);
|
||||||
void client_setactive(struct client_ctx *);
|
void client_setactive(struct client_ctx *);
|
||||||
void client_setname(struct client_ctx *);
|
void client_setname(struct client_ctx *);
|
||||||
|
void client_show(struct client_ctx *);
|
||||||
int client_snapcalc(int, int, int, int, int);
|
int client_snapcalc(int, int, int, int, int);
|
||||||
void client_toggle_freeze(struct client_ctx *);
|
void client_toggle_freeze(struct client_ctx *);
|
||||||
void client_toggle_fullscreen(struct client_ctx *);
|
void client_toggle_fullscreen(struct client_ctx *);
|
||||||
|
9
client.c
9
client.c
@@ -531,6 +531,15 @@ client_hide(struct client_ctx *cc)
|
|||||||
client_set_wm_state(cc, IconicState);
|
client_set_wm_state(cc, IconicState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
client_show(struct client_ctx *cc)
|
||||||
|
{
|
||||||
|
if (cc->flags & CLIENT_HIDDEN)
|
||||||
|
client_unhide(cc);
|
||||||
|
else
|
||||||
|
client_raise(cc);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
client_unhide(struct client_ctx *cc)
|
client_unhide(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
|
5
kbfunc.c
5
kbfunc.c
@@ -471,10 +471,7 @@ kbfunc_menu_client(void *ctx, struct cargs *cargs)
|
|||||||
if ((mi = menu_filter(sc, &menuq, "window", NULL, mflags,
|
if ((mi = menu_filter(sc, &menuq, "window", NULL, mflags,
|
||||||
search_match_client, search_print_client)) != NULL) {
|
search_match_client, search_print_client)) != NULL) {
|
||||||
cc = (struct client_ctx *)mi->ctx;
|
cc = (struct client_ctx *)mi->ctx;
|
||||||
if (cc->flags & CLIENT_HIDDEN)
|
client_show(cc);
|
||||||
client_unhide(cc);
|
|
||||||
else
|
|
||||||
client_raise(cc);
|
|
||||||
if (old_cc)
|
if (old_cc)
|
||||||
client_ptrsave(old_cc);
|
client_ptrsave(old_cc);
|
||||||
client_ptrwarp(cc);
|
client_ptrwarp(cc);
|
||||||
|
@@ -357,10 +357,7 @@ xev_handle_clientmessage(XEvent *ee)
|
|||||||
if ((cc = client_find(e->window)) != NULL) {
|
if ((cc = client_find(e->window)) != NULL) {
|
||||||
if ((old_cc = client_current()) != NULL)
|
if ((old_cc = client_current()) != NULL)
|
||||||
client_ptrsave(old_cc);
|
client_ptrsave(old_cc);
|
||||||
if (cc->flags & CLIENT_HIDDEN)
|
client_show(cc);
|
||||||
client_unhide(cc);
|
|
||||||
else
|
|
||||||
client_raise(cc);
|
|
||||||
client_ptrwarp(cc);
|
client_ptrwarp(cc);
|
||||||
}
|
}
|
||||||
} else if (e->message_type == ewmh[_NET_WM_DESKTOP]) {
|
} else if (e->message_type == ewmh[_NET_WM_DESKTOP]) {
|
||||||
|
Reference in New Issue
Block a user