Avoid weird behavior when switching workspaces