Automatically switch between fullscreen and normal mode.