xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

X.H.WindowSwallowing: Fix single window getting lost #644

Closed slotThe closed 2 years ago

slotThe commented 2 years ago

Description

ConfigureEvents may occur after a window has been deleted, an UnmapEvent has already been sent (and thus xmonad already unmanaged the window), but before a DestroyWindowEvent is caught by the eventHook. For example, this is the case when one uses smartBorders with a single window (such that smartBorders is "active"). The ConfigureEvents sensibly already have an empty stack (because the UnmapEvent has already been received), which we then copy to the history.

Whenever a parent window has been found, the sensible thing to do is to always restore it. The fact that oldStack is Nothing simply encodes an empty workspace and is thus something we definitely need to handle as well.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/638

Checklist