Reduce flickering by unmapping windows before changing stack