fix fullscreen (refactor toggleFullscreen)