GNU bug report logs - #63384
x-display-mm-width and x-display-mm-height both return 0 on wayland

Previous Next

Package: emacs;

Reported by: tomasralph2000 <at> gmail.com

Date: Tue, 9 May 2023 02:06:02 UTC

Severity: normal

Full log


Message #11 received at 63384 <at> debbugs.gnu.org (full text, mbox):

From: tomasralph2000 <at> gmail.com
To: 63384 <at> debbugs.gnu.org
Subject: x-display-mm-width and x-display-mm-height both return 0 on
 wayland
Date: Sat, 13 May 2023 22:32:09 +0000
[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.