Details
-
Task
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
None
Description
The Qt platform plugins provides QtGui with per-screen scale factors and DPI determined using native API. Which API are we using? Is there any other API we should use?
Native (OS/WS implements scaling)
These scale factors are returned through QWindow/QScreen::devicePixelRatio()
OS X
[NSView convertSizeToBacking]
iOS
UIView.contentScaleFactor
Wayland
wl_output.scale
Qt (QtGui implements scaling)
These scale factors are returned through QScreen::logicalDpi() and QScreen::pixelScale(). The DPI is often computed based on screen pixel size and physical size.
X11
screen pixel size
physical size: xcb_randr_get_output_info_reply_t mm_width mm_height
X11/KDE
Should we use a KDE API?
X11/GNOME
Should we use a GNOME API?
Windows
shcoredll.getDpiForMonitor()
Default DPI awareness setting: PROCESS_PER_MONITOR_DPI_AWARE.
Command line option: “dpiawareness”
DPI awareness is not set for AA_PluginApplication applications
Android
android.util.DisplayMetrics().density (for the primary display only)
eglfs
screen pixel size
physical size:
Q_OS_LINUX: ioctl(framebufferDevice, FBIOGET_VSCREENINFO, fb_var_screeninfo) KMS: drmModeConnector::mmWidth mmHeight QT_QPA_EGLFS_PHYSICAL_WIDTH QT_QPA_EGLFS_PHYSICAL_HEIGHT