[Scummvm-tracker] [ScummVM :: Bugs] #12590: MAC OS X: Window getting smaller with each start
ScummVM :: Bugs
trac at scummvm.org
Wed May 26 20:24:36 UTC 2021
#12590: MAC OS X: Window getting smaller with each start
-------------------+-----------------------------
Reporter: criezy | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Port: Mac OS X
Version: | Resolution:
Keywords: | Game:
-------------------+-----------------------------
Comment (by criezy):
The output you gave is actually from gui/gui-manager.cpp line 142. The
debug line in openglsdl-graphics.cpp, which is on line 300 and not 308,
starts with "req:"
I get
{{{
Setting 1008 x 840 -> 864 x 720 -- 1.16667
req: 1008 x 840 cur: 1008 x 840, scale: 2
}}}
The scale we get from `getDpiScalingFactor()` is incorrect. As mentioned
this is not a retina screen, and the scale should be 1 and not 2. I had a
quick look at the code. The implementation of `getDisplayDpiFromSdl()`
looks a bit fiddly with hardcoded default DPIs. 72DPI used to be the DPI
for old (classic) MacOS, and early MacOS X days, but with the transition
to LCD screens this has been deprecated for a long time in favour of a
screen scaling factor (which no fixed default DPI). If we want an accurate
scaling factor in `getDpiScalingFactor()` we might want to use `[NSScreen
backingScaleFactor]` (or the equivalent SDL API if there is one, but I
assume there isn't based on the way we currently try to guess that
scaling).
Also from what I see `getDpiScalingFactor()` can only return 1 or 2, which
may be incorrect. In some cases. With very high DPI screens as found on
some iOS and Android devices, the scaling should be 3 (and thus similarly
assuming 2 for HiDPI backends in `GuiManager::computeScaleFactor()` can be
wrong).
I will try to look at adding a `OSystem::getHiDPIScreenScaleFactor()` this
weekend so that backends can report the proper scaling, and I can
implement this on iOS and macOS.
--
Ticket URL: <https://bugs.scummvm.org/ticket/12590#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list