diff --git a/config.def.h b/config.def.h index 57b14be..3fdfe3b 100644 --- a/config.def.h +++ b/config.def.h @@ -1165,6 +1165,7 @@ static const Key keys[] = { #endif // SHIFTSWAPTAGS_PATCH #if BAR_WINTITLEACTIONS_PATCH { MODKEY|ControlMask, XK_z, showhideclient, {0} }, + { MODKEY|ControlMask, XK_s, unhideall, {0} }, #endif // BAR_WINTITLEACTIONS_PATCH { MODKEY|ShiftMask, XK_c, killclient, {0} }, #if KILLUNSEL_PATCH diff --git a/dwm.c b/dwm.c index 893bd74..c0b332a 100644 --- a/dwm.c +++ b/dwm.c @@ -4572,7 +4572,8 @@ unmanage(Client *c, int destroyed) XSelectInput(dpy, c->win, NoEventMask); XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); + if (!HIDDEN(c)) + setclientstate(c, WithdrawnState); XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); diff --git a/patch/bar_wintitleactions.c b/patch/bar_wintitleactions.c index 36a06fb..c4ea064 100644 --- a/patch/bar_wintitleactions.c +++ b/patch/bar_wintitleactions.c @@ -92,3 +92,15 @@ showhideclient(const Arg *arg) } } +void +unhideall(const Arg *arg) +{ + Client *c = NULL; + for (c = selmon->clients; c; c = c->next) { + if (ISVISIBLE(c)) { + XMapWindow(dpy, c->win); + setclientstate(c, NormalState); + } + } + arrange(selmon); +} diff --git a/patch/bar_wintitleactions.h b/patch/bar_wintitleactions.h index 0c8d5f0..132e9f9 100644 --- a/patch/bar_wintitleactions.h +++ b/patch/bar_wintitleactions.h @@ -3,4 +3,5 @@ static void show(Client *c); static void togglewin(const Arg *arg); static Client * prevtiled(Client *c); static void showhideclient(const Arg *arg); +static void unhideall(const Arg *arg);