I am writing a wm for myself and I have a question about how dwm (and a lot of other WMs that copies dwm, such as katriawm and berry) hides clients.
dwm manage() a client when it receives a MapRequest event and unmanage() it when it receives both a UnmapNotify or a DestroyNotify event, while hide clients by moving it to WIDTH(c) * -2. Well, a window unmapped by a client can be mapped again later until it be destroyed, so dwm can end up manage()ing a client twice if this client chooses to unmap and then map again one of its windows. Why doesn't dwm hide windows by unmapping them, ignore UnmapNotify events, and only manage() a client after a MapRequest event if this client was not found by wintoclient()? I think that hiding a window by unmaping it is a way more obvious approach than moving it to a invisible place. Is there any reason why dwm hides windows like that?