Search Unity

Screen.resolutions on new MacBook Pro 2021 with notch

Discussion in 'macOS' started by Gillissie, Nov 16, 2021.

  1. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    I noticed that Screen.resolutions includes two resolutions for each width. I assume this means one includes the notch area and one is only below the notch. Since the notch area isn't really usable, why would Unity include the resolution that includes the notch area? If a notched height is chosen, it scales everything down proportionbally to fit under the notch and results in not using the full width (black on left and right).

    Will there be an update that addresses this? Maybe there is but I'm using 2020.3.7 currently.
    In the meantime, I have to manually eliminate the larger of the two duplicate width resolutions.
     
  2. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    Oh, in addition to this, it appear that Display.displays[0].systemWidth and Display.displays[0].systemHeight aren't working as expected to get the actual resolution of the main monitor on the MacBook Pro 2021.
     
  3. JakesFable

    JakesFable

    Joined:
    Jan 22, 2018
    Posts:
    2
    I was also running into this issue and have not seen a solution to it. Tested on Unity 2021.2.11
     
  4. igorskugar

    igorskugar

    Joined:
    Aug 17, 2015
    Posts:
    14
    Bump, same issue here, makes no sense.

    Screen.mainWindowDisplayInfo.workArea.height is correct in fullscreen mode, but it returns 2170px instead of 2160px because there is a gap of 10px between the notch and the end of unusable area.
    In windowed mode it return some weird 2158px (no idea where this comes from).

    Also, Screen.safeArea.height should exclude the notch height (it doesn't).
    Screen.cutouts is empty.

    The only method to get 2160px of height is to take one of the resolutions from Screen.resolutions.

    Tested on MBP M1 Max 2021 16" :/
     
    Last edited: Nov 1, 2022
  5. igorskugar

    igorskugar

    Joined:
    Aug 17, 2015
    Posts:
    14
    Any updates on this?
    Unity must have a way to get proper screen height excluding notch,
    because one of the listed resolutions has the correct height of 2160 px in it.
    The question is: How does unity get that height?