Wrong resolution on Macbook pro 2021

Hi,

Making a game on Unity, we saw that the resolution returned by the functions like Screen.currentResolution or Display.main.systemWidth and Display.main.systemHeight don’t set the proper one on Macbook pro M1 2021.

https://support.apple.com/kb/SP854?viewlocale=en_US&locale=ja_JP

In fact, after a dynamic set with those, my screen keeps a 16:9 resolution and black bars are visible on left and right side.

Did you encounter this issue ?

This is the answer.

The problem was that the resolution I got included the notch of the new macbook pro.
I created a plugin to recover the safe area and the margin on all direction. The result is better but not perfect.
We have still black bars on sides but a lot thinner than before.
Apparently the safeAreaInsets are not that accurate that they should or an external problem avoid me to be.

more info.

The visible frame doesn’t work well at the app start so I prefered to use the safeAreaInsets and reduced my resolution manually. Moreover, the margin only includes the notch size but the true safe area has the menu bar height so I use the margin just to check if a notch was there and reduce the height with menu bar heigh I got.

problem solved. =-)

I haven’t personally encountered this specific issue, there are a few things you can try to address it. First, ensure that you have the latest version of Unity installed, as newer updates often include bug fixes and improvements.

You can also check the display settings on your MacBook Pro M1 to verify if the proper resolution and aspect ratio are set. Go to System Preferences > Display and confirm that the settings match your desired resolution and aspect ratio.

Additionally, you might want to explore Unity’s documentation or forums to see if other developers have encountered a similar issue and if any solutions or workarounds have been shared. Unity’s community is active and often provides helpful insights and troubleshooting tips.

Hi. We fixed this issue and Screen.currentResolution should return the screen resolution without the notch area as of 2021.3.21f. Please let us know if you have any other problems :slight_smile: