From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62392: frame-monitor-attributes fails to calculate mm-size for the monitor Date: Thu, 23 Mar 2023 08:47:34 +0800 Message-ID: <87v8isxpi1.fsf@yahoo.com> References: Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1607"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62392@debbugs.gnu.org To: tomasralph2000@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 23 01:48:31 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 1pf981-0000E8-U1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Mar 2023 01:48:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pf97e-0005Uy-I2; Wed, 22 Mar 2023 20:48:06 -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 1pf97a-0005Rv-Mz for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 20:48:04 -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 1pf97a-0002du-DE for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 20:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pf97a-0001x7-5p for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 20:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2023 00:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62392 X-GNU-PR-Package: emacs Original-Received: via spool by 62392-submit@debbugs.gnu.org id=B62392.16795324747448 (code B ref 62392); Thu, 23 Mar 2023 00:48:02 +0000 Original-Received: (at 62392) by debbugs.gnu.org; 23 Mar 2023 00:47:54 +0000 Original-Received: from localhost ([127.0.0.1]:36932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf97R-0001w3-PH for submit@debbugs.gnu.org; Wed, 22 Mar 2023 20:47:54 -0400 Original-Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:32906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf97Q-0001vM-Hq for 62392@debbugs.gnu.org; Wed, 22 Mar 2023 20:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679532466; bh=rCf6sq4sLCa2BzLMP20ry96uo2+Zv9/gPURUxOr+JFI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=o0vCLnfUK8Ef2qoV1Tg6JepF0WxHgvuBV+yA4EbW6dTN/irSfYto9Cqq70BnyRfEBBGmXZ34ZdBKZIlXJlTxrMRaio5wBfKAKOjbgKiMbKq7hJ1r0yYkCzSpjB+lhmlGu2mH1KjjFDkvqg/LVFbrTIq7Yt/ABu7THoisOnepS0pXQvzM87ZVS0efCKfKq3+AZRp7Lj6VwJajJxSeNqE1mRqVEf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K8YhI iuL2KFohvJ_1J7zjIx1N_iZP3_eaz533bfBe8hguzFP5gQ3PRTKFslJdlgOU1zZe0ieJX4weE1Lr rtdPvd.zhpGEo2V1h9fFNfneGvKGBEhlrkYNUsB1Wjm8SoTQiW_nl0358XjlbpAKqcGq0RnYOhOt TzlDg13OhI22xVWxg4WWPlncuiNWyCgQ8qpIzDWwMktTqdbcp2hVnywygd5Yrg0Bst7c.cJ8HbIy wEOzZJQLlPNOix8phcE7KvfZD4VpoWh3EYElq_k4P8DlBH6Nz.fWd.h0xksfkbzUYQcfPn3dc4.l nmf5tkAJnOq.Uq5ri6QVJwLX3zON_v0.K1VA7patlzzqCNEjV6.kmpGv97lNFQbuccXVC.YjmxGZ jA_i2DSnYYLakguFQ8nl1zQgclE38iSop4I7Hfz2UX X-Sonic-MF: X-Sonic-ID: 8f7ae048-fb78-48ab-811e-959a56d0d439 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Thu, 23 Mar 2023 00:47:46 +0000 Original-Received: by hermes--production-sg3-67c57bccff-sjmln (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 80b79c550daf9e408e98fcfbab91e0f2; Thu, 23 Mar 2023 00:47:39 +0000 (UTC) In-Reply-To: (tomasralph's message of "Wed, 22 Mar 2023 19:35:21 +0000") X-Mailer: WebService/1.1.21311 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:258421 Archived-At: tomasralph2000@gmail.com writes: > Is the one causing the error. Where in particular? This section: > > (/ (nth 4 (assq 'geometry atts)) > (nth 2 (assq 'mm-size atts)) > > What's the issue here? `(assq 'mm-size atts)` returns 0. For some reason, emacs can't seem to get my monitor size in milimeters. I have tried > this on two different laptops, they both return proper values. This is happening on my desktop, where it fails. > > I am using Wayland (with Hyprland) and the PGTK version of emacs, which likely has something to do with this. This is what > `frame-monitor-attributes` returns for me: > > ((name . "HDMI") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 0 0) (scale-factor . 1.0) (frames # Rainbow 0x55799b79aa48> #) (source . "Gdk")) > > As you can see, the `mm-size` is 0, so emacs divides by zero. Amazingly, this is not what causes the error, the variable simply gets set to > infinity. The error comes later, when it tries to multiply by infinity. Oh lord. > > This is what emacs outputs on my laptop for the same `frame-monitor-attributes`. Note that my laptop runs the exact same setup, it also runs > Hyprland, it also runs emacs with PGTK, it uses the same config for everything since I have the same dotifles repo cloned in both systems: > > ((name . "0x0335") (geometry 0 0 1366 768) (workarea 0 0 1366 768) (mm-size 310 170) (scale-factor . 1.0) (frames # Emacs at T430 0x55c4c1cdad20> #) (source . "Gdk")) > > This time, the `mm-size` gets properly calculated. > > So something is funky with `frame-monitor-attributes`. Any direction on > how I can further debug this would be appreciated. On the contrary, something is funky with the EDID information from your monitor, so the Wayland compositor is giving out faulty information. What is the actual pixel resolution of the monitor connected to the output named ``HDMI''? If it is indeed 72dpi (or something close), I think tetris should just use `scale-factor' if available. Thanks.