rakkarage's picture

WindowState = WindowState.Fullscreen

gotta save the NativeWindows.Bounds to restore the position and size after switching back to WindowState.Normal?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Fixed in rev. 2330.

rakkarage's picture

thanks... this was working for a while but its not anymore? i am not sure if the fix was reverted or a new bug introduced but switching to full screen and back is weirder then ever...

for example in QuickStart OnUpdateFrame i have

if (Keyboard[Key.Enter])
    WindowState = (WindowState == WindowState.Fullscreen) ? WindowState.Normal : WindowState.Fullscreen;

and it switches to full screen fine the first time but does not come back... it does come back eventually if i keep toggling but not to the right size, kinda

thanks

the Fiddler's picture

Nope, it's working correctly, the issue is that you are switching to fullscreen and back many times a second. Try using the KeyUp event instead:

// Place this in your GameWindow constructor:
Keyboard.KeyUp += (sender, e) =>
{
    if (e.Key == Key.Enter)
        WindowState = (WindowState == WindowState.Fullscreen) ? WindowState.Normal : WindowState.Fullscreen;
};
rakkarage's picture

aha! of course... thank you