Microsoft.Xna.Framework.MacGamePlatform.ExitFullScreen C# (CSharp) Method

ExitFullScreen() public method

public ExitFullScreen ( ) : void
return void
        public override void ExitFullScreen()
        {
            // Changing window style forces a redraw. Some games
            // have fail-logic and toggle fullscreen in their draw function,
            // so temporarily become inactive so it won't execute.
            SuspendUpdatingAndDrawing();
            try
            {
                _wasResizeable = AllowUserResizing;

                // I will leave this here just in case someone can figure out
                // how to do a full screen with this and still get Alt + Tab to
                // friggin work.
                // _mainWindow.ContentView.ExitFullscreenModeWithOptions(new NSDictionary());

                //Changing window style resets the title. Save it.
                string oldTitle = _gameWindow.Title;

                NSMenu.MenuBarVisible = true;
				_mainWindow.StyleMask = NSWindowStyle.Titled | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable;
                if (_wasResizeable)
                    _mainWindow.StyleMask |= NSWindowStyle.Resizable;

                if (oldTitle != null)
                    _gameWindow.Title = oldTitle;

                // Set the level here to normal
                _mainWindow.Level = NSWindowLevel.Normal;

                _mainWindow.IsVisible = false;
                // FIXME: EnterFullScreen gets called very early and interferes
                //        with Synchronous mode, so disabling this for now.
                //        Hopefully this does not cause excessive havoc.
                //_mainWindow.MakeKeyAndOrderFront(Window);
                ResetWindowBounds();
                _mainWindow.HidesOnDeactivate = false;
                _gameWindow.MouseState.LeftButton = ButtonState.Released;
                _gameWindow.MouseState.RightButton = ButtonState.Released;
                _gameWindow.MouseState.MiddleButton = ButtonState.Released;
            }
            finally { ResumeUpdatingAndDrawing(); }
        }