When plugging/unplugging outputs, the xwayland DPI value increases. For instance on my machine it starts at 96, and after plugging an output:
> xdpyinfo | grep dots
resolution: 114x114 dots per inch
If I unplug it:
> xdpyinfo | grep dots
resolution: 131x131 dots per inch
This may be an xwayland bug.
Can also get some pretty fun values by resizing the output window on wayland/x11 backends:
resolution: -2147483648x-2147483648 dots per inch
and on DRM backend by playing with dpms swaymsg "output * dpms on"
resolution: 142x142 dots per inch
(both start with 96x96 dpi as well)
I think the first one might be different but dpms one is probably related
This happens on weston --xwayland too, so this is definitely an xwayland bug.
https://lists.x.org/archives/xorg-devel/2018-July/057305.html
Note: this doesn't happen on GNOME.
> xdpyinfo | grep dots
resolution: 91x91 dots per inch
According to the Arch wiki, "GTK very often overrides the server's DPI via the optional Xresource Xft.dpi". That would explain why it doesn't happen on GNOME. I'm using the same trick.
That is rare but I also noticed that behavior on my laptop. I am not using any external screen.
This is probably happening when the laptop is resuming from sleep.
I will try the Xft.dpi trick.
Fix released as part of xorg-xserver 1.20.9.