Mac Fullscreen Behavior Weirdness

I’m having a strange issue with fullscreen behavior on Mac OS X (Mojave 10.14.5 to be specific). I’m using Window.AllowUserResizing = true; to allow users to resize the window. This also allows the use Mac OS X’s yellow minimize button and green maximize button. Clicking the maximize button puts the application in full screen (the intended behavior), but when trying to exit fullscreen, that green button is now greyed out. In addition, using ctrl-cmd-F to switch back to windowed mode doesn’t work, although it works for switching from windowed mode to fullscreen mode. Here are some images of the issue:
(The application in windowed mode – the buttons at the upper left are all available)
(The application in fullscreen mode – the minimize and maximize buttons are no longer available).

I’m hoping there’s a simple solution to this that will either allow me to disable those buttons and just use a keyboard shortcut for fullscreen switching, or that there’s a way to make those buttons enabled when in fullscreen mode as well.

2 Likes

I’m also experiencing this issue, has a fix been found?

1 Like

In my experience, you have to use a keyboard or mouse event or some other logic in your code to return to windowed mode. MonoGame’s window handling is not native to macOS and it appears that as soon as it goes fullscreen it’s not treated as a window anymore.

For example:
if (Keyboard.GetState().IsKeyDown(Keys.Q))
{
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 600;
graphics.IsFullScreen = false;
graphics.ApplyChanges();
}

You can also try these before the ApplyChanges:
Window.BeginScreenDeviceChange(false);
Window.EndScreenDeviceChange(Window.ScreenDeviceName, 800, 600);

See also this fullscreen switcher tutorial.