SUMMARY I was checking user feedback data that was sent and noticed screen information is not quite correct. Sent telemetry states following, note that both screen marked with devicePixelRatio = 2 and dpi is strange: ``` "screens": { "data": [ { "devicePixelRatio": 2, "dpi": 94, "height": 800, "width": 1280 }, { "devicePixelRatio": 2, "dpi": 99, "height": 1152, "width": 2048 } ], "description": "Розмір і роздільна здатність усіх з’єднаних із комп’ютером дисплеїв.", "telemetryMode": "DetailedSystemInformation" }, ``` While `kscreen-doctor -o | grep -E 'Output|Geometry|Scale'` provides correct information: ``` Output: 1 eDP-1 Geometry: 384,1152 1280x800 Scale: 2 Output: 2 DP-3 Geometry: 0,0 2048x1152 Scale: 1.25 ``` Unfortunately it doesn't say anything about DPI, checked another: ``` $ kscreen-console outputs | grep -E '(Name|Size|Scale):' maxSize: QSize(64000, 64000) minSize: QSize(0, 0) currentSize: QSize(2048, 1952) Name: "eDP-1" MMSize: QSize(345, 215) Size: QSize(2560, 1600) Scale: 2 Name: "" Name: "DP-3" MMSize: QSize(527, 296) Size: QSize(2560, 1440) Scale: 1.25 Name: "PHL 245E1" ``` So 94 = round(2560/345*25.4/2) 99 = round(2560/527*25.4/1.25) where 2560 — physical size of a screen (both), 345 & 527 — size in mm 25.4 — mm per inch 2 & 1.25 — real scale set for screen. STEPS TO REPRODUCE 1. Setup two screens, one with fractional scaling 1.25, other with scaling 2. 2. Check sent kuserfeedback data. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION devicePixelRatio is set to 2 for both screens, which is misleading. Also DPI is recalculated relative to real scaling (unsure if that's intentional).
I wonder if it's rounding up, maybe?
(In reply to Nate Graham from comment #1) > I wonder if it's rounding up, maybe? Not on our side at least: https://invent.kde.org/frameworks/kuserfeedback/-/blob/master/src/provider/core/screeninfosource.cpp#L33 - not sure what exactly QScreen does internally though.
Hmm, it seems QScreen::devicePixelRation in the ends calls to QWaylandScreen::devicePixelRatio: https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/wayland/qwaylandscreen.cpp#n193 Which returns Wayland output *integral* scaling. And true fractional scaling in unknown on output level (not sure about this) until there is surface and there is ask for fractional scale: https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/wayland/qwaylandwindow.cpp#n240
Yeah, using QScreen to get the display scale won't get you the correct values.