From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tomasralph2000@gmail.com Newsgroups: gmane.emacs.bugs 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 Message-ID: <442c86307ca7852252e081725ae6f01f@gmail.com> References: <307a269d4093140c20db72b1b60d57f4@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--=_RainLoop_570_487718963.1684017129" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22005"; mail-complaints-to="usenet@ciao.gmane.io" To: 63384@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 14 00:29:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxxjy-0005Yx-W7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 May 2023 00:29:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxxjb-0003RS-Sw; Sat, 13 May 2023 18:29:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxxja-0003RK-H5 for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 18:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxxja-0000ay-74 for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 18:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxxjZ-0005Is-NQ for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 18:29:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <307a269d4093140c20db72b1b60d57f4@gmail.com> Resent-From: tomasralph2000@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 May 2023 22:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63384 X-GNU-PR-Package: emacs Original-Received: via spool by 63384-submit@debbugs.gnu.org id=B63384.168401691720351 (code B ref 63384); Sat, 13 May 2023 22:29:01 +0000 Original-Received: (at 63384) by debbugs.gnu.org; 13 May 2023 22:28:37 +0000 Original-Received: from localhost ([127.0.0.1]:39854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxxjB-0005IB-4I for submit@debbugs.gnu.org; Sat, 13 May 2023 18:28:37 -0400 Original-Received: from mail-ot1-f42.google.com ([209.85.210.42]:45067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxxj8-0005Hx-Nl for 63384@debbugs.gnu.org; Sat, 13 May 2023 18:28:35 -0400 Original-Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6acc9273e3eso508722a34.2 for <63384@debbugs.gnu.org>; Sat, 13 May 2023 15:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684016909; x=1686608909; h=to:subject:message-id:from:date:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ua6vVmCEIt2Hm1MiOYtLmJA5DDgTeGu70cCRBtdaz8E=; b=gZlKfB2Ms44lFfV7tWDGzI6yTR9ziSX3Jq4stuGlrLt8ub3oBDfUTgS6nV8o8xoacX NFZwk9tkGIm8haP7r46mFFmjk34wLQRlmnym8FQyZoLsoO6z4bp4r96QIw+DM5f5utmp zWtn3n8K3g1BBHixCIHXcHb9tW/Qyv6Cl61re9uo92wuRDz5jUfO3fV8eGNxSenSXXfF 28aCJf/gOu2Z7lr9zdBx4+hGLMLIk7LIcYayzrbXgDSEtglgdl8+vwyuoeA+bk0Oaxlm UW6j2EsbNZDYz2TegHgHuugqVawX5UU7quM2fYO8KFodVym4RlJC1PHL6DoHtn/MYQuV 7TWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684016909; x=1686608909; h=to:subject:message-id:from:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ua6vVmCEIt2Hm1MiOYtLmJA5DDgTeGu70cCRBtdaz8E=; b=HM44YE/SuGKklRSci/eb21wr7gXDE2fbJwoifkF8Tz81BaLjJ+9cmbdVeT57pgAz4C 5rCMhB9MabRlF8+8YyhA/7YHPMWkngVua9OU/A8b7oKfF3Aqhy30Wbc7OdsEngR6iHgX aS4/Aug0ZHdY0hz0p3vKhult8i9LBXcdcQZ2nyY/LSPimeSHlTGmD8D0Ilr7SDKRSneZ EJYQkqsuWkLM2hsC7iLqqJThcJBbCh3VbefExoaYeAVyt+239z+DZLGTQjkWmwe9ZlRT XnEGEkW9lTHqgZfixsiwGBD1WdMCBohlgl5Gu2Qh5DP6ZAhpZYRFgD7Poq49WnPeFQFr dAEA== X-Gm-Message-State: AC+VfDxUzIT8aNdbpusmitZYEA/Pae2aEwW8AIq3r2BDU0beM1br3wMo 1chVDoFkFlKs3lVjixJ3WxUP2S5aha0= X-Google-Smtp-Source: ACHHUZ5jVyPQuKAviSEiqpbnRjg/RHp8MccIGKOpDYVVgoZ/6XjHWROwVhn9BBD9JCkgosI1KQzWWg== X-Received: by 2002:a9d:6b17:0:b0:6a3:4e22:2bd with SMTP id g23-20020a9d6b17000000b006a34e2202bdmr9590099otp.5.1684016908637; Sat, 13 May 2023 15:28:28 -0700 (PDT) Original-Received: from rainloop.titocloud.duckdns.org ([190.18.132.192]) by smtp.gmail.com with ESMTPSA id l12-20020a056830154c00b006ab15b6f50esm5302395otp.59.2023.05.13.15.28.27 for <63384@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 May 2023 15:28:28 -0700 (PDT) X-Mailer: RainLoop/1.13.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261697 Archived-At: ----=_RainLoop_570_487718963.1684017129 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I searched through their issues and apparently this is expected behavior.= According to this (https://gitlab.gnome.org/GNOME/gtk/-/issues/3115) iss= ue, 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.=0A=0AFurthermore, they= don't seem to be willing to add checks in place to calculate a proper va= lue.=0A=0ASo, back to emacs. Maybe it should be fixed on this side? I per= sonally made a workaround in the meantime that checks if these functions = return 0, and if they do, they override the pgtk function that returns th= e display info, calculating the proper values for the mm size. It works g= reat. You can find it here (https://github.com/tralph3/.dotfiles/tree/9ab= 2ab7a2a34827b4912a72c5975edb07d36182f/.config/emacs#display-size-in-milim= iters-workaround), in case anyone finds it useful. ----=_RainLoop_570_487718963.1684017129 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
<= br>I searched through their issues and apparently this is expected behavi= or. According to this issue, returning 0 if the value can't be determined is a do= cumented output. I couldn't find it in the documentation, but it is wha= t 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 meant= ime that checks if these functions return 0, and if they do, they overrid= e the pgtk function that returns the display info, calculating the proper= values for the mm size. It works great. You can find it here, in ca= se anyone finds it useful.
----=_RainLoop_570_487718963.1684017129--