Make fullscreen mode work properly