More fixing for fade-outs. When a window is destroyed, always override the fade out so that the finish_destroy_win function can be called. When a ConfigureNotify event is processed on an unmapped window, don't set the clipChanged = True. Fixes unmap->configure causing flashing during the fade-out.
Fix races that occur when a window id is destroyed and recreated very quickly. This behaviour happens when restarting the window manager. Don't use windows that are destroyed when restacking other windows or when handling events on a window id. It is possible for the same window id to appear in the window list multiple times if it is destroyed then created before the destroy fade-out completes.
Save ConfigureNotify events for unmapped windows until the window maps. If a window moves while it is unmapped, it should not affect its fade-out. A window can move/resize while it is fading out. Even if you don't delete the pixmap in that case, the fade-out will be shown in the wrong place and the wrong area on screen will be marked damaged when the window is gone without this patch.
Fix some rare memory leaks and behaviour when a mapped window is reparented away from root When a window that is mapped is reparented away from root, that is the same as it being completely unmapped+destroyed from our persective. The window will no longer be in the same position on screen, and we will no longer want to listen to events on it. Prior to this, the w->pixmap would not be freed when a mapped window was reparented away from root, and damage would not be updated for the screen correctly.
Fixes for window fade-outs When a window resizes while it is unmapped, don't destroy it's pixmap, as that kills and fade going on. If a window is already unmapped (and therefore already fading out, don't override the fadeout with a new one when the window is destroyed. When a window maps, if it already has a pixmap, this is stale data, so free it so that a new pixmap can be retrieved from the newly mapped window.