Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

BUG - Changing from FullScreen to Windowed Mode on Yosemite

Discussion in 'Editor & General Support' started by sevensails, Nov 14, 2014.

  1. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    I'm using Unity 4.5.5

    My game when running in FullScreen, it uses the current Desktop Resolution.

    In runtime, I can change the game to Windowed Mode, so I does this to be sure the Game Window will fit the Screen :

    Code (csharp):
    1.  
    2. Screen.SetResolution((int) (DesktopResolution.x*0.8f), (int) (DesktopResolution.y*0.8f), false);
    3.  
    This works very well in Windows, but in MAC it only works if I starts the game in Windowed Mode (So I can change to FullScreen/WindowedMode how much I want which the problems does not occurs), but if I starts the game in FullScreen and try to change to Windowed Mode in Runtime, the Screen.SetResolution does not seems to work as expected, the Game Window seems to change it's Height, but it's Width keeps with the Full Desktop Width.

    I tried to delay the Screen.SetResolution command to some seconds after the Screen.FullScreen command, and it almost worked (It correct the windows size). But most of time the game goes to Windowed Mode but now without any visible border.

    I can create a simple test case to anybody test if necessary, but there is some way to solve this or it is a Bug?

    Thanks
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Hmm. What Mac Fullscreen Mode have you selected in the player settings? Would think Fullscreen Windowed is appropriate.
     
  3. peterc

    peterc

    Joined:
    Jun 3, 2014
    Posts:
    2
    I've found a similar issue on Yosemite. If Unity starts in a fullscreen video mode, a call to SetResolution(width, height, false) in the first frame will change the resolution but will not change to windowed mode. Even a direct call to Screen.fullScreen = false won't change the fullscreen state. If I wait for a second before making the call then it works fine.

    The game is built with the FullscreenWindow mode.
     
  4. SimonDansereauArtifice

    SimonDansereauArtifice

    Joined:
    Apr 22, 2014
    Posts:
    1
    I have the same issue with Unity 5 on Yosemite. If I wait for a second before setting Screen.fullScreen to false, I see the game going into windowed mode, but the screen stays black. I can barely see my cursor and I hear the sounds but nothing shows up. On Windows, everything works as expected.
     
  5. kocherovets.d

    kocherovets.d

    Joined:
    Mar 5, 2014
    Posts:
    10
    I have this problem too.
     
  6. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Let's report this bug!
     
  7. bruno-martelli

    bruno-martelli

    Joined:
    Aug 13, 2014
    Posts:
    14
    My app in windowed mode on mac its fine, if i run it fullscreen - the screen is black.
    Unity version is 4.6.1, the same app is fine on OsX 10.10.1 mac laptop
    BUT
    not fine on Mac Mini 10.6.3 which is what i want to run it on
    ...oh yes and the screen the Mini is attached to is 1920 x 1080
     
  8. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    I have also encountered this bug, I cannot switch in code from fullscreen mode to windowed on OSX. Has this issue been reported?
    I'm running Unity 5.0.2f on Yosemite
     
  9. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    I've done my own test, with a completely default scene running this script,
    voidStart () {

    Screen.fullScreen = false;
    Screen.SetResolution(800,600,false);
    }
    But this goes fullscreen and horribly stretched. If I run the project with the dialog pop up I can select Windowed true and get the desired behaviour, but this should be possible in code.
     
  10. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    I changed the company name and it seems to offer the correct behaviour. It's very strange.
     
  11. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Well has Unity QA ever confirmed anything?