Fix and improve BAR_WINTITLEACTIONS_PATCH (#442)
Introduced an unhideall function that can be used to reveal all hidden client in the current view. Added a change to unmanage to avoid changing the window state from IconicState to WithdrawnState when the window manager stops managing windows (which happens when restarting). Previously a hidden window would disappear when restarting dwm because: - when hidden the window would be unmapped and having the window state of IconicState - when restarting the window would remain unmapped while the window state would become WithdrawnState - which would prevent the window from being picked up by the scan function when the window manager starts
This commit is contained in:
@@ -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
|
||||
|
||||
1
dwm.c
1
dwm.c
@@ -4572,6 +4572,7 @@ unmanage(Client *c, int destroyed)
|
||||
XSelectInput(dpy, c->win, NoEventMask);
|
||||
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
|
||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||
if (!HIDDEN(c))
|
||||
setclientstate(c, WithdrawnState);
|
||||
XSync(dpy, False);
|
||||
XSetErrorHandler(xerror);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user