unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: tomasralph2000@gmail.com
To: 63384@debbugs.gnu.org
Subject: bug#63384: x-display-mm-width and x-display-mm-height both return 0 on wayland
Date: Sat, 13 May 2023 22:32:09 +0000	[thread overview]
Message-ID: <442c86307ca7852252e081725ae6f01f@gmail.com> (raw)
In-Reply-To: <307a269d4093140c20db72b1b60d57f4@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1200 bytes --]

  parent reply	other threads:[~2023-05-13 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  2:08 bug#63384: x-display-mm-width and x-display-mm-height both return 0 on wayland tomasralph2000
2023-05-10  0:39 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-13 22:32 ` tomasralph2000 [this message]
2023-05-14  4:59   ` Eli Zaretskii
2023-05-14  5:22     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-14 18:57 ` bug#63384: x-display-mm-width and x-display-mm-height both tomasralph2000
2023-06-05  9:12   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-05  3:29 ` bug#63384: x-display-mm-width and x-display-mm-height both return 0 on wayland William A Cadegan-Schlieper
2023-06-05  9:13   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=442c86307ca7852252e081725ae6f01f@gmail.com \
    --to=tomasralph2000@gmail.com \
    --cc=63384@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).