MonoGame/MonoGame

Application crashes/fails when full screen and you move another windows app on top of it

SteveReddoch opened this issue · 0 comments

Prerequisites

  • I have verified this issue is present in the develop branch
  • I have searched open and closed issues to ensure it has not already been reported.

MonoGame Version

Monogame 3.8.1.303

Which MonoGame platform are you using?

MonoGame Windows Desktop Application (mgwindowsdx)

Operating System

Windows 11

Description

When monogame is in full screen in a DirectX project, and you move a window ontop of that full-screen monogame, it will crash and not recover.

Steps to Reproduce

I created a fresh MONOGAME app using Visual Studio 2022. Total fresh, from scratch.

This is all I changed:
public Game1()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = “Content”;
IsMouseVisible = true;
_graphics.PreferredBackBufferWidth = 2560;
_graphics.PreferredBackBufferHeight = 1440;
Window.IsBorderless = true;
_graphics.IsFullScreen = true;
_graphics.HardwareModeSwitch = true;
_graphics.SynchronizeWithVerticalRetrace = true;
_graphics.ApplyChanges();
}

If you do the above, then run the code it should display a BLUE screen.

Now, take a window and DRAG another window across the blue screen. (your app is still running in Visual Studio)

What I get is the window you are trying to drag caused the monogame to kind of minimize and then it will show up as a white screen and it looks to have crashed.

Minimal Example Repo

No response

Expected Behavior

It should work correctly based on the settings that were applied:

Borderless FullScreen - mouse can move to and from the game to another application without any issues - the game should continue to play as one would expect in a full-screen borderless game. I can drag a window ontop of the game and it works and continues to run with no issues. It should not matter the resolution. IF the resolution is an issue, it should gracefully minimize itself.

FullScreen - if the game is bound by the fullscreen mode and again for any set resoution, and the person ALT+TABS out, the game should gracefully minimize itself and then upon the player clicking the icon, it should restore the game to its previous resolution without issues.

Resulting Behavior

The game crashes - it is still running, but it no longer is drawing and I can't find a way to get it working.

Files

No response