Screen.SetResolution on Mac

Hi,

I have a standalone Windows/Mac application running as a window (at 800x600). I press a GUI button to change the resolution to 1024x768 and switch it to full screen mode, using Screen.SetResolution. I then press another button to change the resolution to 1280x720 and switch back to windowed mode (also using Screen.SetResolution).

However, this only works on the PC. On a Mac, the application ends up windowed but at 800x600 resolution instead of 1280x720. (The resolution becomes whatever it was before the application last changed to full screen mode). Even if I hard code the width and height on the last step, it is ignored (but only on the Mac). The problem occurs no matter what resolutions are used.

What am I doing wrong here?

I ran into the same problem today. It seems to be a bug on Unity’s end. I made a button to confirm resolution/full screen options and not until the second time it’s clicked (after going from full to the wrong-sized windowed mode) does it adjust properly. Super frustrating

I can confirm that this issue does appear to be a Unity issue on Lion onwards and is NOT fixed in Unity 4.5.

The workaround is to toggle full screen independent of the resolution and set the resolution when not in full screen. However, due to the asynchronous nature of setResolution and full screen toggle, this becomes a very interesting timing issue.

I’m using MacBook Pro (Retina, 13-inch, Early 2015), and appear the same problem. whatever the resolution was set, it became to full screen!
But in Windows, it is OK!!

still not fixed in Unity 2017.3 1f1 at least on OS 10.13.3 Retina display Macbook Pro 15"

Have an application that starts in windowed 630X480 and then launches by user click to a setting the user selects (resolution and full screen or not).

If I select 1440X900 resolution all the time and then work on FS or not:

  • The first Time I run it on a new build with FS ON it goes to the same sized window as was created in the initial start but at the correct resolution.
  • Do it again and get the same thing.
  • Run FS OFF: goes to larger screen, no boarders. Kinda looks like FS mode but on part of the screen
  • Run FS OFF: goes to this windowed mode larger screen (correct)
  • Run FS ON: Goes to full screen mode
  • Run FS ON: Goes back to this same sized screen but higher resolution. No window.
  • Run FS ON: same deal
  • Run FS OFF: Goes to full screen mode
  • Run FS OFF: Goes to windowed large screen (not FS). (correct)
  • Run FS OFF: Goes to windowed large screen (not FS). (correct)
  • Run FS OFF: Goes to windowed large screen (not FS). (correct)
  • Run FS ON: Goes to full screen mode (first click)
  • Run FS ON: second clicks goes back to this same sized screen but higher resolution. No window.
  • Run FS ON: second clicks goes back to this same sized screen but higher resolution. No window.
  • Run FS OFF: first click Goes to large screen (not FS) without boarder
  • Run FS OFF: first click on play goes to this windowed mode larger screen (correct)
  • Run FS OFF: first click on play goes to this windowed mode larger screen (correct)

Pretty much this call does whatever it feels like doing most of the time.