How to fix screen-resolution detection?

Jan Engelhardt jengelh at inai.de
Sat Jan 8 22:38:47 UTC 2022


On Saturday 2022-01-08 20:57, Alan Stern wrote:

>The screen resolution on my laptop is not reported accurately.  Here's 
>an extract from the output of xdpyinfo (under Xwayland):
>
>screen #0:
>  dimensions:    3200x1800 pixels (847x476 millimeters)
>  resolution:    96x96 dots per inch
>
>The number of pixels is correct, but the size and resolution values 
>smack of a bogus default.

The way I remember it:

 1. Xorg(!) would read EDID once on startup, and set the DPI value
    based on it. // Or you have your environment set to a fixated
    DPI value, then that is used.

 2. millimeter numbers reported afterwards through X are not
    EDID-based, but simply area size divided by DPI.

As such, I have, for example:

  dimensions:    1920x1080 pixels (508x286 millimeters)
  resolution:    96x96 dots per inch

on both a 12" and a 13" laptop.

Now, the DPI value has been fixated at 96 recently again -
https://www.phoronix.com/scan.php?page=news_item&px=X.Org-Server-21.1.2
because, in summary, you cannot determine a sensible global DPI
value if a system has two or more monitors of different pixel
density. Either the font is too small or too big for either screen.

(And the only way to truly have separate DPI values per monitor
might be a Xinerama-style setup where each monitor is its own
independent X (sub)screen object, hence DISPLAY=":0.0".)

And Wayland probably just behaves the same as Xorg, for the same
reasons.


More information about the wayland-devel mailing list