Fixed a bug when attempting to switch fullscreen.