My X screen has the incorrect dimensions and DPI (taken from running xdpyinfo). It’s an Acer XB273K GP 27" 4K screen:
dimensions: 3840x2160 pixels (1016x572 millimeters)
resolution: 96x96 dots per inch
Its real dimensions are approx 597mm x 336mm.
Previously I would add the correct dimensions to /etc/X11/xorg.conf but it’s been a few years since I configured a Linux desktop, so I wanted to check that I’m doing it the right way. $XDG_SESSION_TYPE says I’m running x11, not Wayland, which is fine as last I read, Emacs had trouble with Wayland. I’m using the nvidia drivers “xorg-x11-drv-nvidia-470.57.02” from the rpmfusion-nonfree-updates repo.
What is the correct method for adding/modifying the screen dimensions in x11 on Fedora 34?
Normally, the kernel gets EDID information from the monitor to know its properties including its size. If this information is incorrect, it is possible to create your own EDID file and tell the kernel to use it using boot command line options. This is perhaps more complicated than doing the Xorg configuration you have done, but on the other hand it will not be limited to X. If/when you switch to Wayland, it will work in that environment too, for example.