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
When changing colour scheme during runtime using xrdb the systray and
icons would keep the original colours.
To work around that the systray icon windows need to be redrawn after
changing the background pixel value. Just calling XClearWindow for
each systray window results in the systray icons disappearing, they
do not automatically redraw. The solution is apparently to send an
Expose event to each window which should in principle trigger a redraw
from the application side.
One way to achieve this is to move the window out of the drawable area.
When the window is then brought back into view the X server will send
the Expose event for the window. The "easiest" way to do this is to
move the entire systray window out of view as part of the xrdb call.
It is possible to do this in the draw_systray function itself, but we
probably do not want to do this every single time the bar is drawn and
it may also cause some noticeable flickering.
This issue is isolated to using the systray without the alpha patch.
* Add swallow/window icon compatibility. Without this, after a client is
swallowed the old icon (usually from the terminal emulator) is
preserved. This is noticeable if you, say run `mpv` from a terminal
emulator which is a common use case.
---------
Co-authored-by: speedie <speedie@duck.com>