Monitor resolution larger than hardware specs (Due to wrong use of HiDPI on MS-Windows)


I am trying to get the resolution of an external monitor ASUS MS238H, whose specs clearly state that the resolution is 1920*1080 ( NVIDIA control panel also agrees with this.

However, ffter running Screen(‘Resolution’,1), I got this:

ans = 

  struct with fields:

        width: 2400
       height: 1350
    pixelSize: 32
           hz: 60

This is very strange.
Finally, Screen(‘Resolution’,0), gives this for the merged monitors:

ans = 

  struct with fields:

        width: 3840
       height: 1080
    pixelSize: 32
           hz: 144

The integrated monitor resolution is also 1920*1080, so that is in agreement with these last results.

Can someone explain why the resolutions are diverging in the second monitor? Why is it 2400 x 1350?

My laptop is a msi katana gf76.

Sounds like 1.25x scaling. Maybe some scaling factor is set wrong in the display setup gui? Make sure it is 100% for all monitors.

Yes, I have indeed 1.25x scalling. But the funny thing is that the monitor that is being scaled is the primary monitor. But the change of resolution is being applied to the secondary monitor.
Also, such a a scalling should decrease the resolution, not increase it.
So what seems Psychotoolbox is doing is, instead of decreasing the resolution of the primary monitor (that was scaled) from 1920x1080 to 1536x864, it is actually increasing the resolution of the secondary unscaled monitor from 1920x1080 to 2400x1350.
I trully don’t understand this behaviour.

Edit: If I close MATLAB and remove the scalling of the primary monitor, both of them have 1920x1080 resolution when I restart. Then, If I reapply the scalling without closing MATLAB, I get the primary monitor with 1536x864 and the secondary with 1920x1080. This is what I want.
But then, if I restart MATLAB, I get again 1920x1080 for the primary monitor and 2400x1350 for the secondary, and this seems wrong for me.

If I use the built-in MATLAB function get(0, 'MonitorPositions'), I get the correct sizes. But Pyshcotoolbox seems to have different ideas, that I don’t understand.
Outside MATLAB the secondary monitor does not change. What changes is the primary monitor that was rescaled (desktop icons get bigger). So why is Psychotoolbox instead messing with the secondary monitor that should be unchanged? And why this only happens after restarting MATLAB?

Psychtoolbox isn’t doing (or “messing with”) anything wrong here. It is a design limitation of MS-Windows HiDPI scaling, combined with design limitations of afaik all past and current Matlab versions for Windows, one of the consequences being that the OS lies to PTB about actual monitor resolutions in various situations (aka DPI virtualization). It’s neither PTB’s fault, nor in its power atm. to fix these OS and runtime issues.

We have recommendations on our website against using MS-Windows for HiDPI (ie. scaling factors other than 100% aka 1.0x), or multi-display, if timing matters, and especially on multi-display setups on our webpage, which you probably ignored, and PTB normally outputs specific diagnostic messages and tips wrt. HiDPI scaling and how to minimize or avoid problems, which you apparently also ignored, and points to help RetinaDisplay for more info, which you ignored. Following the tips may help. Using Octave instead of Matlab, which is at least in theory more advanced in its HiDPI handling on Windows (per monitor DPI aware) than Matlab (only global system DPI aware), may minimize or avoid problems. But HiDPI on Windows is a moving target, so your mileage may vary.

There are certain ideas I could explore to improve on this by completely killing support for anything older than latest Windows-10 and Windows-11, but the lack of funding by the majority of our short-sighted users makes this a low priority atm.

Thanks for the answer.
Unfortunately the PTB documentation is a bit hard to read for the occasional beginner like me.