GNU bug report logs -
#63384
x-display-mm-width and x-display-mm-height both return 0 on wayland
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
I searched through their issues and apparently this is expected behavior. According to this (https://gitlab.gnome.org/GNOME/gtk/-/issues/3115) issue, returning 0 if the value can't be determined is a documented output. I couldn't find it in the documentation (https://docs.gtk.org/gdk3/method.Monitor.get_width_mm.html), but it is what it is.
Furthermore, they don't seem to be willing to add checks in place to calculate a proper value.
So, back to emacs. Maybe it should be fixed on this side? I personally made a workaround in the meantime that checks if these functions return 0, and if they do, they override the pgtk function that returns the display info, calculating the proper values for the mm size. It works great. You can find it here (https://github.com/tralph3/.dotfiles/tree/9ab2ab7a2a34827b4912a72c5975edb07d36182f/.config/emacs#display-size-in-milimiters-workaround), in case anyone finds it useful.
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.