| Summary: | XWayland reports wrong DPI info to X11 applications in Wayland session (e.g. xdpyinfo shows wrong default DPI value 96dpi instead of the true pixel density) | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Matthias Nagel <matthias.nagel> |
| Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | CLOSED UPSTREAM | ||
| Severity: | normal | CC: | cfeck, nate |
| Priority: | NOR | ||
| Version First Reported In: | 6.1.5 | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| URL: | https://gitlab.freedesktop.org/xorg/xserver/-/issues/1772 | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
I'm afraid this isn't how Wayland works, sorry. xdpyinfo reports information about X11, and in a Wayland session it'll get info about XWayland. I don't understand why this bug has been closed. This bug report is targets the XWayland abstraction layer which fails to correctly translate Wayland information about the screen into the appropriate X11 information (and hence xdpyinfo is misled). This bug affects all legacy X11 applications which run inside XWayland. The wrongly shown information by xdypinfo are only the symptom, not the actual bug. I am not sure which component of KDE implements XWayland, but I assume it is part of the KWin compositor. So let me rephrase the bug report: The XWayland component of KDE only translates the screen resolution (i.e. width and height in pixels) correctly to X11 applications under XWayland, but fails to correctly report the physical size of the screen (i.e. width and height in mm) or the true, physical pixel density (i.e. dpi). XWayland is not a part of KWin; it's a separate project. I'm pretty sure what you're seeing is a design decision in XWayland, but you're welcome to report this to them at https://gitlab.freedesktop.org/xorg/xserver/-/issues; maybe I'm mistaken about that. Finally managed to post the bug upstream: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1772 |
SUMMARY With Plasma/KWin 6.1.5 the command `xdypinfo | egrep resolution` always returns the default value of 96dpi instead of the true, physical pixel density of the screen. This always happens independent of any set global scaling factor or whether the environment variable `QT_USE_PHYSICAL_DPI=1` is set or not. I also notice that non-native KDE apps are unable to correctly scale their "workbench" such that 100% scaling matches the true physical size of the objects (e.g. GIMP, FreeCAD, etc.) I am not sure whether this is observation is related to the problem or independent of it. OBSERVED RESULT I have a 311mm × 175mm laptop panel (14" diagonal) with 2560 × 1440 pixels, i.e. a resolution of 209dpi. The EDID reports 310mm × 174mm and 210dpi, but that's fine. I ran three different tests: a) KWin scaling factor 100%, `QT_USE_PHYSICAL_DPI=1` not set b) KWin scaling factor 215%, `QT_USE_PHYSICAL_DPI=1` not set (because 209dpi÷96dpi = 2,177 ≅ 215%) c) KWin scaling factor 100%, `QT_USE_PHYSICAL_DPI=1` set Result for test a): $ wayland-info xdg_output_v1 name: 'eDP-1' description: 'LG Display eDP-1-0x0419' logical_x: 0, logical_y: 0 logical_width: 2560, logical_height: 1440 interface: 'wl_output' name: eDP-1 description: LG Display eDP-1-0x0419 x: 0, y: 0, scale: 2, physical_width: 310 mm, physical_height: 174 mm, make: 'LG Display', model: 'eDP-1-0x0419', mode: width: 2560 px, height: 1440 px, refresh: 60.004 Hz $ kscreen-doctor -o Output: 1 eDP-1 Modes: 0:2560x1440@60*! 1:1600x1200@60 2:1280x1024@60 3:1024x768@60 4:1920x1200@60 5:1280x800@60 6:2560x1440@60 7:1920x1080@60 8:1600x900@60 9:1368x768@60 10:1280x720@60 Geometry: 0,0 2560x1440 Scale: 1.0 $ xdpyinfo dimensions: 2560x1440 pixels (677x381 millimeters) resolution: 96x96 dots per inch Result for test b): $ wayland-info xdg_output_v1 name: 'eDP-1' description: 'LG Display eDP-1-0x0419' logical_x: 0, logical_y: 0 logical_width: 1190, logical_height: 670 interface: 'wl_output' name: eDP-1 description: LG Display eDP-1-0x0419 x: 0, y: 0, scale: 2, physical_width: 310 mm, physical_height: 174 mm, make: 'LG Display', model: 'eDP-1-0x0419', mode: width: 2560 px, height: 1440 px, refresh: 60.004 Hz $ kscreen-doctor -o Output: 1 eDP-1 Modes: 0:2560x1440@60*! 1:1600x1200@60 2:1280x1024@60 3:1024x768@60 4:1920x1200@60 5:1280x800@60 6:2560x1440@60 7:1920x1080@60 8:1600x900@60 9:1368x768@60 10:1280x720@60 Geometry: 0,0 1190x670 Scale: 2.15 $ xdpyinfo dimensions: 2560x1440 pixels (677x381 millimeters) resolution: 96x96 dots per inch Result for test c): $ wayland-info xdg_output_v1 name: 'eDP-1' description: 'LG Display eDP-1-0x0419' logical_x: 0, logical_y: 0 logical_width: 1190, logical_height: 670 interface: 'wl_output' name: eDP-1 description: LG Display eDP-1-0x0419 x: 0, y: 0, scale: 2, physical_width: 310 mm, physical_height: 174 mm, make: 'LG Display', model: 'eDP-1-0x0419', mode: width: 2560 px, height: 1440 px, refresh: 60.004 Hz $ kscreen-doctor -o Output: 1 eDP-1 Modes: 0:2560x1440@60*! 1:1600x1200@60 2:1280x1024@60 3:1024x768@60 4:1920x1200@60 5:1280x800@60 6:2560x1440@60 7:1920x1080@60 8:1600x900@60 9:1368x768@60 10:1280x720@60 Geometry: 0,0 1190x670 Scale: 1.0 $ xdpyinfo dimensions: 2560x1440 pixels (677x381 millimeters) resolution: 96x96 dots per inch SUMMARY OF OBSERVED RESULT xdpyinfo always reports the wrong physical size and wrong pixel density. EXPECTED RESULT xdpyinfo should report the correct values. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Gentoo Linux 2.15 KDE Plasma Version: 6.1.5 KDE Frameworks Version: 6.5.0 Qt Version: 6.7.2 ADDITIONAL INFORMATION IMHO on a large picture KWin should provide two options: a) to set the physical DPI value and b) a GUI scaling factor. The current situation is a regression compared to KDE 5 and X11/X.Org. The physical DPI value and the GUI scaling factor serve two different purposes. I wrote a long (sorry) post on that here: https://discuss.kde.org/t/return-dpi-resolution-adjustments-in-font-settings-support/11860/29.