DekstopGL ToggleFullScreen does not work

Calling DeviceManager.ToggleFullScreen() for DesktopGL just gives me a borderless window the same size as the window, it doesn’t cover the whole screen. On DesktopDX it works as expected. I’m using the NuGet packages.

I haven’t used the nuget yet,

try making a method in game1 that sets IsFullscreen to true and call ApplyChanges().

If thats not enough you might need to also set the prefered back buffer to the current adapter display mode width height or DisplayMode’s, before calling apply changes or isfullscreen = true;

If it has to be a toggle your probabaly going to have to cheat with some bool switching,

If(IsFullscreen){ IsFullscreen = false;}
else( IsFullscreen = true;}

You will have to time it if its linked to a button, so it doesn’t double fire or fire like 10x in a row.

That is if it works at all.
Togglefullscreen was broke a long time ago im not sure it was ever fixed on the regular gl version either. If i remember IsFullScreen had some quirks too about getting called to early and you might have to initially do it at the end of load content to start it that way. I don’t about nuget at all but.

That’s basically how i manually worked around it on the regular gl version. I just made my own static call which required static references to the window and graphics those references also must be re-assigned at the bottom of load content (not initialize) in case of a device reset at least graphics does, that’s if it works and or you intend to call it from outside the class.

ToggleFullscreen literally does

IsFullscreen = !IsFullscreen;
ApplyChanges();

@Thraka you probably mean the 3.5 NuGet packages? I’d expect those to work. Though if you mean the development feed package the issue makes more sense.

Ya i pulled out my old test and ran it on win7 gl it works but.

There are some odd things shown in the output below though which only displays things that have actually changed during the call…

It changed my display mode when it went to fullscreen why im not sure to 800 x 600 though.

It should have went into the fullscreen mode at my current desktop resolution.

Don’t see anything in my test that would be a reason to do it, but when i exit back out it did put it back into the prior mode.

Here was the output of the changes that occur under a successful toggle.

Auto Script Commands Ended

    __________________________________________________________________________________________________________________________

INPUT  F12   toggle fullscreen (their is no call to apply changes like this)

    Code
    gdm.ToggleFullScreen();

  "A Resize Is Occuring" Window.ClientSizeChanged has fired... OnResize(object sender, EventArgs e);
  Within OnResize.... My ApplyingTheChanges() Was NOT called to trigger this

   ------ changes that occured -----------
   ---------------------------------------
   diff gdm.FullScreen CHANGE FROM False TO True
   diff gd.PresentationParameters.IsFullScreen CHANGE FROM False TO True
   diff Window.ClientBounds CHANGE FROM {X:240 Y:272 Width:800 Height:480} TO {X:0 Y:0 Width:800 Height:480}
   diff gd.DisplayMode.(Width, Height) CHANGE FROM {X:1280 Y:1024} TO {X:800 Y:600}
   diff gd.DisplayMode.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:1280 Height:1024} TO {X:0 Y:0 Width:800 Height:600}
   diff gd.Adapter.CurrentDisplayMode.WH CHANGE FROM {X:1280 Y:1024} TO {X:800 Y:600}
   diff gd.Adapter.CurrentDisplayMode.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:1280 Height:1024} TO {X:0 Y:0 Width:800 Height:600}

   ---------------------------------------

   ------ changes that occured -----------
   ---------------------------------------
   ---------------------------------------

  "A Resize Is Occuring" Window.ClientSizeChanged has fired... OnResize(object sender, EventArgs e);
  Within OnResize.... My ApplyingTheChanges() Was NOT called to trigger this

   ------ changes that occured -----------
   ---------------------------------------
   diff Window.ClientBounds CHANGE FROM {X:0 Y:0 Width:800 Height:480} TO {X:0 Y:0 Width:800 Height:600}
   diff gd.PresentationParameters.Bounds CHANGE FROM {X:0 Y:0 Width:800 Height:480} TO {X:0 Y:0 Width:800 Height:600}
   diff gd.PresentationParameters.BackBuffer(WidthHeight) CHANGE FROM {X:800 Y:480} TO {X:800 Y:600}
   diff gd.Viewport CHANGE FROM {X:0 Y:0 Width:800 Height:480 MinDepth:0 MaxDepth:1} TO {X:0 Y:0 Width:800 Height:600 MinDepth:0 M
axDepth:1}
   diff gd.Viewport.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:800 Height:480} TO {X:0 Y:0 Width:800 Height:600}
   ---------------------------------------

__________________________________________________________________________________________________________________________

INPUT  F12   toggle fullscreen (their is no call to apply changes like this)

    Code
    gdm.ToggleFullScreen();

  "A Resize Is Occuring" Window.ClientSizeChanged has fired... OnResize(object sender, EventArgs e);
  Within OnResize.... My ApplyingTheChanges() Was NOT called to trigger this

   ------ changes that occured -----------
   ---------------------------------------
   diff gdm.FullScreen CHANGE FROM True TO False
   diff gd.PresentationParameters.IsFullScreen CHANGE FROM True TO False
   diff Window.ClientBounds CHANGE FROM {X:0 Y:0 Width:800 Height:600} TO {X:240 Y:272 Width:800 Height:480}
   diff gd.PresentationParameters.Bounds CHANGE FROM {X:0 Y:0 Width:800 Height:600} TO {X:0 Y:0 Width:800 Height:480}
   diff gd.PresentationParameters.BackBuffer(WidthHeight) CHANGE FROM {X:800 Y:600} TO {X:800 Y:480}
   diff gd.Viewport CHANGE FROM {X:0 Y:0 Width:800 Height:600 MinDepth:0 MaxDepth:1} TO {X:0 Y:0 Width:800 Height:480 MinDepth:0 M
axDepth:1}
   diff gd.Viewport.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:800 Height:600} TO {X:0 Y:0 Width:800 Height:480}
   diff gd.DisplayMode.(Width, Height) CHANGE FROM {X:800 Y:600} TO {X:1280 Y:1024}
   diff gd.DisplayMode.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:800 Height:600} TO {X:0 Y:0 Width:1280 Height:1024}
   diff gd.Adapter.CurrentDisplayMode.WH CHANGE FROM {X:800 Y:600} TO {X:1280 Y:1024}
   diff gd.Adapter.CurrentDisplayMode.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:800 Height:600} TO {X:0 Y:0 Width:1280 Height:1024}

   ---------------------------------------

   ------ changes that occured -----------
   ---------------------------------------
   ---------------------------------------

__________________________________________________________________________________________________________________________

Are you using PresentationParameters.BackBufferWidth or PreferredBackBufferWidth ?

I’m always using PreferredBackBufferWidth. And I’m using the NuGet packages. From what I can tell going through issues on GitHub, a lot of the issues with GL fullscreen were fixed after the NuGet packages were released. Those haven’t been updated in (getting close to) a year.