How to discover what is the native resolution of a display?

Dear Mario
Thanks. In the interim (like you) I implemented a lookup table for 15" MacBook Pros and 27" iMacs, since that’s what I use for experiments. (There have been several models per year). Apple’s spec pages list the native resolution for all macs, as far as I can tell. That works.

I am a big fan of PsychImaging(‘AddTask’,‘General’,‘UseRetinaResolution’) and use it practically always. However, “do nothing” isn’t practical in my lab because resolution is sticky and I don’t know what was run yesterday, when a student might have used the System Preference:Displays to increase magnification to read something. It’s my impression that UseRetinaResolution does not completely override the resolution set in Displays. What is working for me is to use Resolution, if necessary, to set the native resolution and then call UseRetinaResolution. That works. However, it’s not portable because it depends on my lookup table which only includes 15" MacBook Pros and 27" iMacs.

Might we enhance Screen to return the preferred resolution? You’ve documented that it’s not perfectly reliable but it would still be a decent fallback for the case when the computer isn’t in my native resolution table.

nativeRes=Screen('NativeResolution, windowOrScreen);

Best
Denis