Search Unity

Standalone launches in Full Screen on first launch, on second launch it's a weird windowed state

Discussion in 'Editor & General Support' started by minibeaststudios, May 15, 2019.

  1. minibeaststudios

    minibeaststudios

    Joined:
    Aug 9, 2017
    Posts:
    35
    This is another head-scratcher for me.

    When building the game on PC, it's setup to run at full screen by default. This works perfectly fine the very first time I run the standalone exe.

    However, every launch thereafter results in a strange windowed version of the game being run, which is larger than my screen size, cutting off a significant portion of the game view - and I cannot force this to become full screen. It's hard to show on here but you can see the window bar at the top of the gif below:

    standalone_is_not_fullscreen.gif

    For sanity, here are my build settings (though like I say, these work perfectly fine the very first time the standalone is launched):

    upload_2019-5-15_11-2-35.png

    I am not doing anything in code that effects how the game is displayed.

    One thing I have noticed is that if I delete my RegEdit folder relevant to the build, it will then launch correctly at Full Screen again.

    So my question is: why does it change to this strange windowed state from the 2nd launch on wards, and how do I stop that from happening?
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    So windows standalone build - and its launching one time in full screen, which is what you want it to do, and then the second time its launching in a fullscreen window. Is that correct?

    If so, I would try showing the settings window before every launch, so the user can select between fullscreen, windowed, and so on. If changing the values there does not work, that might be an editor bug, and should be reported to unity, but make sure that it won't work even when setting it directly before launching the standalone build.
     
  3. minibeaststudios

    minibeaststudios

    Joined:
    Aug 9, 2017
    Posts:
    35
    This is correct, yes.

    Changing the values in the resolution dialog does work, if I select windowed here it will fit to the window to the screen as expected.

    One thing I have noticed actually, is when I uncheck 'windowed' and launch the game (so that it's full screen), the next time I launch the game the resolution dialog has re-ticked 'windowed' again for me by default. Could this be the culprit? Something behind the scenes always setting the game to 'windowed' regardless of my player settings or previous resolution dialog choices?
     
    MD_Reptile likes this.
  4. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Hmm, that sounds like your getting closer to whats going wrong - you should tinker more with the settings in the editor, and leave that standalone settings box enabled still - but don't change the settings in the box that pops up when your starting the game.

    I know, that sounds probably a little odd haha, but just to see if the editors settings "stick" even when that box shows up, so we can tell if it is the editor build settings for resolution and presentation that are causing that, or if its something else.

    By the way, your intro screen looks pretty snazzy.
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    maybe not related,
    but sometimes ive had similar issue where i need to press alt+enter to make that window full screen,
    and then it stayed full screen at start ever since..
     
    MD_Reptile likes this.