From unknown Sat Jun 14 03:55:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62392: frame-monitor-attributes fails to calculate mm-size for the monitor Resent-From: tomasralph2000@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Mar 2023 20:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62392 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62392@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167951777912717 (code B ref -1); Wed, 22 Mar 2023 20:43:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Mar 2023 20:42:59 +0000 Received: from localhost ([127.0.0.1]:36800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf5IP-0003J2-Kv for submit@debbugs.gnu.org; Wed, 22 Mar 2023 16:42:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:50772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf4Du-0001bW-Pr for submit@debbugs.gnu.org; Wed, 22 Mar 2023 15:34:15 -0400 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 1pf4Du-0000wH-6Z for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 15:34:14 -0400 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pf4Dr-0002R1-51 for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 15:34:13 -0400 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1755e639b65so20537053fac.3 for ; Wed, 22 Mar 2023 12:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679513649; h=to:subject:message-id:from:date:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4GID6M1HNBr69o6K3+sClUUR/E1Q+zXK5sD/mGPkvI0=; b=NnRcnmd5cnxVsUGXnsQEV9ocx7BQA+sHkl/IoirYvpV7PD9wTwOJoYdQtCA+ELMtLe PX4PDNVqdzOqWU5YRgsp+iHKhCa+HQ5E1qJV+oWujCTXOz6+zy11jDGgCj5IXSOKLOqy jQYx/22SEKwPAoyp5oY4ErsI4eiqNW0hauXVqKYAPDryzVSBzJW7KP4o4sty5gG0Bz3F VRwgo2/eujuxx1DSdCZxgCe82oj5l0vkv8U0iIgG9WlCB/4YS3NQrLIWUhdTslg9KVZl eLXxA20UrAOhGFoWSPPtsqstom7iVA6+9zBgydap8ciC41L3QCcTGD6g3f+08yJZ5FKs 9FBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679513649; h=to:subject:message-id:from:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4GID6M1HNBr69o6K3+sClUUR/E1Q+zXK5sD/mGPkvI0=; b=7Tvf3cTQUmRdtOXRhGC2YUsF7a7WAnTdQom7n3AChS7qKR4ciWljyv1FTAl2dF0Rzk jlxoINo5VHCjHR1Sl2Y8VLqBFRtZv8r6IYyUcCWWzsp7HMR3zwGYSY3ew4TCWV4JjYAZ 9z8hLOG8LRftj4yaVTnuR0OG23khhJ7Hmbp7hxGu1Y3FEoH8LQIumA4OW5c/yUa3oMGX LeDSBfREJN1wZF3F95lhskMYpLxaM/lfHtH3x8Aj3ABg6uikcn+L0/vsJWphzJVN4M9y MhPcjOTZuY9IpiHcwNzd8oNr4dHXGIWN+mRhb73bj8YfSX42GupBDUTWYZGqBPXOZeon JM9g== X-Gm-Message-State: AAQBX9eJnleIfv4VDYEHp8YernxcT1przOGQXE1MlapvZJLCOnZ8BcS1 ojcGlb1JZk5YnzgQWavhErsnEEAD8fk= X-Google-Smtp-Source: AKy350Z6ZJMoRUbTSWhbMpWBGVetkPknICt4HrJ9AkOIfRUDQhNS/pOPdaeUS99FjeeO/FyoTz/hzA== X-Received: by 2002:a05:6870:1d1:b0:16e:8ce5:b94 with SMTP id n17-20020a05687001d100b0016e8ce50b94mr639484oad.43.1679513649071; Wed, 22 Mar 2023 12:34:09 -0700 (PDT) Received: from rainloop.titocloud.duckdns.org ([186.189.239.39]) by smtp.gmail.com with ESMTPSA id ya9-20020a0568714cc900b001723a2e84b6sm5520302oab.6.2023.03.22.12.34.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Mar 2023 12:34:08 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 22 Mar 2023 19:35:21 +0000 Content-Type: multipart/alternative; boundary="--=_RainLoop_248_271416756.1679513721" X-Mailer: RainLoop/1.13.0 From: tomasralph2000@gmail.com Message-ID: Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=tomasralph2000@gmail.com; helo=mail-oa1-x2e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Mailman-Approved-At: Wed, 22 Mar 2023 16:42:56 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) ----=_RainLoop_248_271416756.1679513721 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Whenever I try to run tetris, or snake, or pong, I get "arithmetic overfl= ow error". After digging a bit, I found where the issue lies. This functi= on:=0A=0A (defun gamegrid-calculate-glyph-size ()=0A "Calculate appropria= te glyph size in pixels based on display resolution.=0A Return a multiple= of 8 no less than 16."=0A (let ((atts (frame-monitor-attributes))=0A y-p= itch)=0A (setq y-pitch (cond=0A (atts=0A (/ (nth 4 (assq 'geometry atts))= =0A (nth 2 (assq 'mm-size atts))=0A (or (cdr (assq 'scale-factor atts)) 1= .0)))=0A ((and (display-pixel-height) (display-mm-height))=0A (/ (display= -pixel-height) (float (display-mm-height))))))=0A (if y-pitch=0A (let* ((= pixels (* y-pitch gamegrid-glyph-height-mm))=0A (rounded (* (floor (/ (+ = pixels 4) 8)) 8)))=0A (max 16 rounded))=0A 16)))=0A=0AIs the one causing = the error. Where in particular? This section:=0A=0A (/ (nth 4 (assq 'geom= etry atts))=0A (nth 2 (assq 'mm-size atts))=0A=0AWhat'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 laptop= s, they both return proper values. This is happening on my desktop, where= it fails.=0A=0AI am using Wayland (with Hyprland) and the PGTK version o= f emacs, which likely has something to do with this. This is what `frame-= monitor-attributes` returns for me:=0A=0A ((name . "HDMI") (geometry 0 0 = 1920 1080) (workarea 0 0 1920 1080) (mm-size 0 0) (scale-factor . 1.0) (f= rames # #) (source . "Gdk"))=0A=0AAs 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.=0A=0AThis is what emacs outputs o= n 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 dotif= les repo cloned in both systems:=0A=0A ((name . "0x0335") (geometry 0 0 1= 366 768) (workarea 0 0 1366 768) (mm-size 310 170) (scale-factor . 1.0) (= frames # #) (source . "Gdk"))=0A=0AThis time, the `mm-size` gets properl= y calculated.=0A=0ASo something is funky with `frame-monitor-attributes`.= Any direction on=0Ahow I can further debug this would be appreciated.=0A= In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version=0A 3.24.= 37, cairo version 1.17.8) of 2023-03-21 built on Rainbow=0ARepository rev= ision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd=0ARepository branch: make= pkg=0ASystem Description: Arch Linux=0A=0AConfigured using:=0A 'configure= --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib=0A --localst= atedir=3D/var --mandir=3D/usr/share/man --with-gameuser=3D:games=0A --wit= h-modules --without-libotf --without-m17n-flt --without-gconf=0A --with-n= ative-compilation=3Dyes --with-native-compilation=3Daot=0A --with-xinput2= --with-pgtk --without-xaw3d --with-sound=3Dalsa=0A --with-tree-sitter --= without-gpm --without-compress-install=0A '--program-transform-name=3Ds/(= [ec]tags)/1.emacs/'=0A 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pi= pe -fno-plt -fexceptions=0A -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3D= format-security=0A -fstack-clash-protection -fcf-protection'=0A LDFLAGS= =3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'=0A=0AConfigured fea= tures:=0AACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ J= PEG JSON=0ALCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PD= UMPER PGTK=0APNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_B= ARS=0ATREE_SITTER WEBP XIM GTK3 ZLIB=0A=0AImportant settings:=0A value of= $LANG: en_US.UTF-8=0A locale-coding-system: utf-8-unix=0A=0AMajor mode: = Lisp Interaction=0A=0AMinor modes in effect:=0A which-key-mode: t=0A rece= ntf-mode: t=0A global-git-commit-mode: t=0A magit-auto-revert-mode: t=0A = shell-dirtrack-mode: t=0A override-global-mode: t=0A vertico-mouse-mode: = t=0A vertico-mode: t=0A corfu-popupinfo-mode: t=0A global-corfu-mode: t= =0A corfu-mode: t=0A pixel-scroll-precision-mode: t=0A global-display-lin= e-numbers-mode: t=0A display-line-numbers-mode: t=0A tooltip-mode: t=0A g= lobal-eldoc-mode: t=0A eldoc-mode: t=0A show-paren-mode: t=0A electric-in= dent-mode: t=0A mouse-wheel-mode: t=0A file-name-shadow-mode: t=0A global= -font-lock-mode: t=0A font-lock-mode: t=0A blink-cursor-mode: t=0A line-n= umber-mode: t=0A transient-mark-mode: t=0A auto-composition-mode: t=0A au= to-encryption-mode: t=0A auto-compression-mode: t=0A=0ALoad-path shadows:= =0A/home/tralph3/.local/share/emacs/elpa/jsonrpc-1.0.16/jsonrpc hides /us= r/share/emacs/30.0.50/lisp/jsonrpc=0A/home/tralph3/.local/share/emacs/elp= a/transient-20230304.1149/transient hides /usr/share/emacs/30.0.50/lisp/t= ransient=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.200= 4/use-package hides /usr/share/emacs/30.0.50/lisp/use-package/use-package= =0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-pa= ckage-core hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-co= re=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-= package-jump hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-= jump=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/us= e-package-bind-key hides /usr/share/emacs/30.0.50/lisp/use-package/use-pa= ckage-bind-key=0A/home/tralph3/.local/share/emacs/elpa/use-package-202302= 03.2004/use-package-delight hides /usr/share/emacs/30.0.50/lisp/use-packa= ge/use-package-delight=0A/home/tralph3/.local/share/emacs/elpa/use-packag= e-20230203.2004/use-package-diminish hides /usr/share/emacs/30.0.50/lisp/= use-package/use-package-diminish=0A/home/tralph3/.local/share/emacs/elpa/= bind-key-20230203.2004/bind-key hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/bind-key=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230= 203.2004/use-package-lint hides /usr/share/emacs/30.0.50/lisp/use-package= /use-package-lint=0A/home/tralph3/.local/share/emacs/elpa/use-package-202= 30203.2004/use-package-ensure hides /usr/share/emacs/30.0.50/lisp/use-pac= kage/use-package-ensure=0A/home/tralph3/.local/share/emacs/elpa/project-0= .9.8/project hides /usr/share/emacs/30.0.50/lisp/progmodes/project=0A/hom= e/tralph3/.local/share/emacs/elpa/eglot-20221020.1010/eglot hides /usr/sh= are/emacs/30.0.50/lisp/progmodes/eglot=0A/home/tralph3/.local/share/emacs= /elpa/xref-1.6.2/xref hides /usr/share/emacs/30.0.50/lisp/progmodes/xref= =0A=0AFeatures:=0A(shadow sort mail-extr emacsbug rect pong novice shortd= oc bug-hunter=0Ahelp-fns radix-tree cl-print disp-table tetris gamegrid m= ule-util=0Amagit-bookmark bookmark time eglot array jsonrpc ert pp ewoc d= ebug=0Abacktrace find-func xref flymake-proc flymake project org-faces=0A= org-version org-macs which-key dashboard dashboard-widgets all-the-icons= =0Aall-the-icons-faces data-material data-weathericons data-octicons=0Ada= ta-fileicons data-faicons data-alltheicons recentf tree-widget=0Awid-edit= ffap orderless magit-submodule magit-obsolete magit-blame=0Amagit-stash = magit-reflog magit-bisect magit-push magit-pull magit-fetch=0Amagit-clone= magit-remote magit-commit magit-sequence magit-notes=0Amagit-worktree ma= git-tag magit-merge magit-branch magit-reset=0Amagit-files magit-refs mag= it-status magit magit-repos magit-apply=0Amagit-wip magit-log which-func = imenu magit-diff smerge-mode diff=0Adiff-mode git-commit log-edit message= sendmail yank-media puny dired=0Adired-loaddefs rfc822 mml mml-sec epa d= erived epg rfc6068 epg-config=0Agnus-util time-date mm-decode mm-bodies m= m-encode mail-parse rfc2231=0Arfc2047 rfc2045 mm-util ietf-drums mail-prs= vr mailabbrev mail-utils=0Agmm-utils mailheader pcvs-util add-log magit-c= ore magit-autorevert=0Aautorevert filenotify magit-margin magit-transient= magit-process=0Awith-editor shell pcomplete server magit-mode transient = magit-git=0Amagit-base magit-section format-spec crm dash edmacro kmacro= =0Ause-package-bind-key bind-key easy-mmode vertico-mouse vertico=0Arust-= utils thingatpt rust-mode rust-rustfmt rust-playpen rust-compile=0Acompil= e text-property-search comint ansi-osc ansi-color rust-cargo=0Akind-icon = svg-lib color svg dom xml corfu-popupinfo corfu compat=0Acompat-29 use-pa= ckage-ensure use-package-core pixel-scroll cua-base ring=0Acomp comp-cstr= warnings icons rx cl-extra help-mode display-line-numbers=0Apcase bug-hu= nter-autoloads neotree-autoloads org-bullets-autoloads=0Awhich-key-autolo= ads markdown-mode-autoloads dashboard-autoloads info=0Apackage browse-url= url url-proxy url-privacy url-expand url-methods=0Aurl-history url-cooki= e generate-lisp-file url-domsuf url-util mailcap=0Aurl-handlers url-parse= auth-source cl-seq eieio eieio-core cl-macs=0Apassword-cache json subr-x= map byte-opt gv bytecomp byte-compile=0Aurl-vars cl-loaddefs cl-lib rmc = iso-transl tooltip cconv eldoc paren=0Aelectric uniquify ediff-hook vc-ho= oks lisp-float-type elisp-mode mwheel=0Aterm/pgtk-win pgtk-win term/commo= n-win pgtk-dnd tool-bar dnd fontset=0Aimage regexp-opt fringe tabulated-l= ist replace newcomment text-mode=0Alisp-mode prog-mode register page tab-= bar menu-bar rfn-eshadow isearch=0Aeasymenu timer select scroll-bar mouse= jit-lock font-lock syntax=0Afont-core term/tty-colors frame minibuffer n= advice seq simple cl-generic=0Aindonesian philippine cham georgian utf-8-= lang misc-lang vietnamese=0Atibetan thai tai-viet lao korean japanese euc= jp-ms cp51932 hebrew greek=0Aromanian slovak czech european ethiopic indi= an cyrillic chinese=0Acomposite emoji-zwj charscript charprop case-table = epa-hook=0Ajka-cmpr-hook help abbrev obarray oclosure cl-preloaded button= loaddefs=0Atheme-loaddefs faces cus-face macroexp files window text-prop= erties=0Aoverlay sha1 md5 base64 format env code-pages mule custom widget= keymap=0Ahashtable-print-readable backquote threads dbusbind inotify=0Ad= ynamic-setting system-font-setting font-render-setting cairo gtk pgtk=0Al= cms2 multi-tty make-network-process native-compile emacs)=0A=0AMemory inf= ormation:=0A((conses 16 319167 94405)=0A (symbols 48 21107 3)=0A (strings= 32 87375 4726)=0A (string-bytes 1 3487955)=0A (vectors 16 53395)=0A (vec= tor-slots 8 1061140 40998)=0A (floats 8 774 1186)=0A (intervals 56 2980 5= 34)=0A (buffers 984 30)) ----=_RainLoop_248_271416756.1679513721 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
W= henever I try to run tetris, or snake, or pong, I get "arithmetic overflo= w error". After digging a bit, I found where the issue lies. This functio= n:

(defun gamegrid-calculate-glyph-size ()
"Calculate appropr= iate glyph size in pixels based on display resolution.
Return a multi= ple of 8 no less than 16."
(let ((atts (frame-monitor-attributes)) y-pitch)
(setq y-pitch (cond
(atts
(/ (nth 4 (assq 'geometr= y atts))
(nth 2 (assq 'mm-size atts))
(or (cdr (assq 'scale-facto= r atts)) 1.0)))
((and (display-pixel-height) (display-mm-height))
= (/ (display-pixel-height) (float (display-mm-height))))))
(if y-pitc= h
(let* ((pixels (* y-pitch gamegrid-glyph-height-mm))
(rounded (= * (floor (/ (+ pixels 4) 8)) 8)))
(max 16 rounded))
16)))

= 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 happen= ing on my desktop, where it fails.

I am using Wayland (with Hyprla= nd) and the PGTK version of emacs, which likely has something to do with = this. This is what `frame-monitor-attributes` returns for me:

((n= ame . "HDMI") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size = 0 0) (scale-factor . 1.0) (frames #<frame *scratch* - GNU Emacs at Rai= nbow 0x55799b79aa48> #<frame 0x55799d4561e0>) (source . "Gdk"))<= br>
As you can see, the `mm-size` is 0, so emacs divides by zero. Amaz= ingly, 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 `fra= me-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 confi= g for everything since I have the same dotifles repo cloned in both syste= ms:

((name . "0x0335") (geometry 0 0 1366 768) (workarea 0 0 1366= 768) (mm-size 310 170) (scale-factor . 1.0) (frames #<frame *scratch*= - GNU Emacs at T430 0x55c4c1cdad20> #<frame 0x55c4c356b7e0>) (s= ource . "Gdk"))

This time, the `mm-size` gets properly calculated.=

So something is funky with `frame-monitor-attributes`. Any direct= ion on
how I can further debug this would be appreciated.


<= br>In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3= .24.37, cairo version 1.17.8) of 2023-03-21 built on Rainbow
Repositor= y revision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd
Repository branch= : makepkg
System Description: Arch Linux

Configured using:
= 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --mandir=3D/usr/share/man --with-gameuser=3D:gam= es
--with-modules --without-libotf --without-m17n-flt --without-gconf=
--with-native-compilation=3Dyes --with-native-compilation=3Daot
= --with-xinput2 --with-pgtk --without-xaw3d --with-sound=3Dalsa
--with= -tree-sitter --without-gpm --without-compress-install
'--program-tran= sform-name=3Ds/\([ec]tags\)/\1.emacs/'
'CFLAGS=3D-march=3Dx86-64 -mtu= ne=3Dgeneric -O2 -pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=3D= 2 -Wformat -Werror=3Dformat-security
-fstack-clash-protection -fcf-pr= otection'
LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now= '

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNU= TLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATI= VE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THR= EADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Im= portant settings:
value of $LANG: en_US.UTF-8
locale-coding-syste= m: utf-8-unix

Major mode: Lisp Interaction

Minor modes in e= ffect:
which-key-mode: t
recentf-mode: t
global-git-commit-mo= de: t
magit-auto-revert-mode: t
shell-dirtrack-mode: t
overri= de-global-mode: t
vertico-mouse-mode: t
vertico-mode: t
corfu= -popupinfo-mode: t
global-corfu-mode: t
corfu-mode: t
pixel-s= croll-precision-mode: t
global-display-line-numbers-mode: t
displ= ay-line-numbers-mode: t
tooltip-mode: t
global-eldoc-mode: t
= eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mous= e-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t=
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t transient-mark-mode: t
auto-composition-mode: t
auto-encryptio= n-mode: t
auto-compression-mode: t

Load-path shadows:
/home= /tralph3/.local/share/emacs/elpa/jsonrpc-1.0.16/jsonrpc hides /usr/share/= emacs/30.0.50/lisp/jsonrpc
/home/tralph3/.local/share/emacs/elpa/trans= ient-20230304.1149/transient hides /usr/share/emacs/30.0.50/lisp/transien= t
/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-= package hides /usr/share/emacs/30.0.50/lisp/use-package/use-package
/h= ome/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-package= -core hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-core/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-pack= age-jump hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-jump=
/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-p= ackage-bind-key hides /usr/share/emacs/30.0.50/lisp/use-package/use-packa= ge-bind-key
/home/tralph3/.local/share/emacs/elpa/use-package-20230203= .2004/use-package-delight hides /usr/share/emacs/30.0.50/lisp/use-package= /use-package-delight
/home/tralph3/.local/share/emacs/elpa/use-package= -20230203.2004/use-package-diminish hides /usr/share/emacs/30.0.50/lisp/u= se-package/use-package-diminish
/home/tralph3/.local/share/emacs/elpa/= bind-key-20230203.2004/bind-key hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/bind-key
/home/tralph3/.local/share/emacs/elpa/use-package-2023= 0203.2004/use-package-lint hides /usr/share/emacs/30.0.50/lisp/use-packag= e/use-package-lint
/home/tralph3/.local/share/emacs/elpa/use-package-2= 0230203.2004/use-package-ensure hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/use-package-ensure
/home/tralph3/.local/share/emacs/elpa/projec= t-0.9.8/project hides /usr/share/emacs/30.0.50/lisp/progmodes/project
= /home/tralph3/.local/share/emacs/elpa/eglot-20221020.1010/eglot hides /us= r/share/emacs/30.0.50/lisp/progmodes/eglot
/home/tralph3/.local/share/= emacs/elpa/xref-1.6.2/xref hides /usr/share/emacs/30.0.50/lisp/progmodes/= xref

Features:
(shadow sort mail-extr emacsbug rect pong novice= shortdoc bug-hunter
help-fns radix-tree cl-print disp-table tetris ga= megrid mule-util
magit-bookmark bookmark time eglot array jsonrpc ert = pp ewoc debug
backtrace find-func xref flymake-proc flymake project or= g-faces
org-version org-macs which-key dashboard dashboard-widgets all= -the-icons
all-the-icons-faces data-material data-weathericons data-oc= ticons
data-fileicons data-faicons data-alltheicons recentf tree-widge= t
wid-edit ffap orderless magit-submodule magit-obsolete magit-blamemagit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch=
magit-clone magit-remote magit-commit magit-sequence magit-notes
m= agit-worktree magit-tag magit-merge magit-branch magit-reset
magit-fil= es magit-refs magit-status magit magit-repos magit-apply
magit-wip mag= it-log which-func imenu magit-diff smerge-mode diff
diff-mode git-comm= it log-edit message sendmail yank-media puny dired
dired-loaddefs rfc8= 22 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util time-date = mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-ut= il ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pc= vs-util add-log magit-core magit-autorevert
autorevert=20filenotify ma= git-margin magit-transient magit-process
with-editor shell pcomplete s= erver magit-mode transient magit-git
magit-base magit-section format-s= pec crm dash edmacro kmacro
use-package-bind-key bind-key easy-mmode v= ertico-mouse vertico
rust-utils thingatpt rust-mode rust-rustfmt rust-= playpen rust-compile
compile text-property-search comint ansi-osc ansi= -color rust-cargo
kind-icon svg-lib color svg dom xml corfu-popupinfo = corfu compat
compat-29 use-package-ensure use-package-core pixel-scrol= l cua-base ring
comp comp-cstr warnings icons rx cl-extra help-mode di= splay-line-numbers
pcase bug-hunter-autoloads neotree-autoloads org-bu= llets-autoloads
which-key-autoloads markdown-mode-autoloads dashboard-= autoloads info
package browse-url url url-proxy url-privacy url-expand= url-methods
url-history url-cookie generate-lisp-file url-domsuf url-= util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-cor= e cl-macs
password-cache json subr-x map byte-opt gv bytecomp byte-com= pile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc pa= ren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode m= wheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fon= tset
image regexp-opt fringe tabulated-list replace newcomment text-mo= de
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isea= rch
easymenu timer select scroll-bar mouse jit-lock font-lock syntaxfont-core term/tty-colors frame minibuffer nadvice seq simple cl-generi= c
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese<= br>tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew gree= k
romanian slovak czech european ethiopic indian cyrillic chinese
c= omposite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-ho= ok help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loa= ddefs faces cus-face macroexp files window text-properties
overlay sha= 1 md5 base64 format env code-pages mule custom widget keymap
hashtable= -print-readable backquote threads dbusbind inotify
dynamic-setting sys= tem-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty ma= ke-network-process native-compile emacs)

Memory information:
((= conses 16 319167 94405)
(symbols 48 21107 3)
(strings 32 87375 47= 26)
(string-bytes 1 3487955)
(vectors 16 53395)
(vector-slots= 8 1061140 40998)
(floats 8 774 1186)
(intervals 56 2980 534)
= (buffers 984 30))
----=_RainLoop_248_271416756.1679513721-- From unknown Sat Jun 14 03:55:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62392: frame-monitor-attributes fails to calculate mm-size for the monitor 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 X-GNU-PR-Keywords: To: tomasralph2000@gmail.com Cc: 62392@debbugs.gnu.org Received: via spool by 62392-submit@debbugs.gnu.org id=B62392.16795324747448 (code B ref 62392); Thu, 23 Mar 2023 00:48:02 +0000 Received: (at 62392) by debbugs.gnu.org; 23 Mar 2023 00:47:54 +0000 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 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+AZRp7Lj6VwJajJxSeNqE1mRqVEfkp6NWLdNFrqRliWYhQpM3HebLTc3V2holcFYbpB1tUC97JKXjpwlhOi6I6EIHBYVVzHLFqf4N6P8vF19SB24T6YG28Hd79ISENAMZGb9G94mPGeTBOe9O/XmC0EQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679532466; bh=2JeW72k+B6st+Oum3mBv0D5LKUU5Ul5kIhWBXi+2vTe=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=C5YNamPReNPXJs8oFHKDccFeN9KGIFym1AR1tDIG2tfSMNIj2AD5pJ6S2B8r9QFxfOjeDhsC9U7v4dw3JOx6ZvSTt+RmsKn5qJjkJk2zXP2Gf25t9rwcdksr2DzrV1SmUn+pBUJkmPsmBizO9xoy1tgB9s4HxF8siJZabk/OyfSLGuMnxSdSDOolBb6NprtjO6U8bdQGNjbuRAQ9Et7gcfFjzdPPZhx+HIB1iCzOt6hsGgvbwduFPEHZ/tXLxFGEnsM1lDTnqYFNVUfYXR4NZUaJfBCyYBKHQFAtUJt4Q1NKwmnCMdB4s/3zV90V05TRJVwTZH0wPHZsUAe8pJ9WQw== X-YMail-OSG: RSHqH4kVM1lBSdFWOKI5zJdN4yBO94FgYat2lYp7Rd8V8hehCTJTqvkczIleXbe wJRnKmHwuUHIusg3DsZYXSPRiUyOKwKPOXcjjbzItG9u3WKsHtoF72ktE0IyJivdb5cgX7E00gCv 4ZuYQUZ3Nqqn8ZmWozKUzfcWyo58NMCM2f3tM0fuHn.eQmLy_wPwDyZWL2V_8BnE8ZUXpwQiLUPe 9k0O4OIuFfh0C8lDHHPgjZjwb5EMf37zY3G4J.VOprB_XQns9LxQGjkMSX4NQacboP_NzHyDp85K u.DWgnQLSO9fJ2rHrspJTIhIpVOO2LY5FDCxFxAVXARowe7zDJrZDcfHh.pmxOOUdcPIC48TOoIh b95gGlIgF2_uP6twPe.J_eRAqSX1tKXmT6nmyNzatv.j28WhXctoi_Io9YSGKhT.3TxSDspK8YhI iuL2KFohvJ_1J7zjIx1N_iZP3_eaz533bfBe8hguzFP5gQ3PRTKFslJdlgOU1zZe0ieJX4weE1Lr rtdPvd.zhpGEo2V1h9fFNfneGvKGBEhlrkYNUsB1Wjm8SoTQiW_nl0358XjlbpAKqcGq0RnYOhOt TzlDg13OhI22xVWxg4WWPlncuiNWyCgQ8qpIzDWwMktTqdbcp2hVnywygd5Yrg0Bst7c.cJ8HbIy wEOzZJQLlPNOix8phcE7KvfZD4VpoWh3EYElq_k4P8DlBH6Nz.fWd.h0xksfkbzUYQcfPn3dc4.l nmf5tkAJnOq.Uq5ri6QVJwLX3zON_v0.K1VA7patlzzqCNEjV6.kmpGv97lNFQbuccXVC.YjmxGZ jA_i2DSnYYLakguFQ8nl1zQgclE38iSop4I7Hfz2UXoqyyehZJnQ46uA3VCIkNHw1RiNOp4822pw BF7kWKg4fBpPMAY1.sre6cZZpqj0vJyKabgFg5TvALGLiBCOQBymz501ir0HqaISE20h7O8fWedX cPcwEnUiOrszuX2yCCX6U6xwKGRKGHDWcTbIaMPD3mWN0Jglcl7A54kiV1r0HvVJnzD_II_OTh4s G5d_K4Mel7MHjLk48X9YqJcOsA5EW7cBzpzuQVyCcJC3gwe3dmPyFNbZXZFzmGq.Xfg3Ynaswmq2 9NzKVVVPvv_noeG3PD66pv_w0gHn2w6yIiPQmPrHgGwqO9SU.G1e6WHmlHgqSMjh2I5P.LM8J8rQ ..MEjPqpFmn0Ta8d1en5VVUzJMrQJ7XA8y8XjubSzKbrajEkQ6_RGKohLrWA1vVNQivDRc9XNXuJ leLEUv8qhMxmxNdA18lxf2.tlJqdsMQq.2YeiAaluKudCXhI0iDnUOfXwoHZ_tFN7EnG.2aHjTyi eRkKrW88y5tVWsviPBpwh3H8F8egKCJXxWCnfLPcQMswH8dN70nuHDuXGb8pvQ_A72httVw1Ia32 3U1iTp3UPjeKZePLeZZrdpv_QOwdAH0s1oys_k5CCPAmhoU1FgU9lbat1l1_fwqzeg.xT7yniQwa 7A5MUq5Zldqh7x22JCAHJIwOqY22VBtOFhVmwYFeXkZkgYRY3EL_Yk031RqKPxoO6sfQBMLyBcw3 rLjw2yxhf3M_Ij3XX8LTE7GIrwrGOXbXnjdgwtjZdr0EWGF1NpGVMlHZIxZcdMvptG7.OLXmt.ll sdNG0arJgnSGQqBgrs23mwTZ6HS7Eu6mIR0tNk4ATJ7rZF_q7kpL1_u6XF1FmaVtUFJcDS86_fc1 AkEVIMa4NUUHs8daQmoC94xmjul5Jf2.qAk92F2LSVVFt8AWZnBoxqgw4wmqkzNuLCDTGJ42ugET njV5C0utXSuEEeaaasvXs4BpybFP1psFSIIL3FSF623UI4Akoc.MpIP1gSDUr8ic77jTAH1Q_Y8s YcYa2urQnvjgmTE_E3npp3LZiN6cXeLkWfkIu1rBMarhxdK6Z2hUDJSgZ9EyUUe96kOcrCdU4wPx MOhUwZyfjcPROtVGdGPUF3Nq6WS7Yj511gKkYM7E28JTz_FIlWE5TsnjXLtgEPnbpC5gYXh8ezMM 3zihUEchWNz7WMoWQhkO68NDlD1X9dFbR0LzVoUCtyubpUaRT92JLZENnh6cQH7ergpGwgsliAKN aOQkfYzzCk23y7NHfel9QakwJBAzJA25Q4m0g9h_kd3ok5UwIQVHaZ8vw6WGhPShEbjwvuSjvbJG PAzsxTqZeBQmNz2Kdt2XnhMuLOgsYod3nDDrfFFOFki23.6Uwp25ECBsdl42svZFe4ZByQEiVb.p Ezy.mdDEihTvkYMY3o9hKECc5OtesLuD3Ae3jXOu.QLWpTp7EtI3_KY5PM2PP5Dsp6Q-- X-Sonic-MF: X-Sonic-ID: 8f7ae048-fb78-48ab-811e-959a56d0d439 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 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) From: Po Lu In-Reply-To: (tomasralph's message of "Wed, 22 Mar 2023 19:35:21 +0000") References: Date: Thu, 23 Mar 2023 08:47:34 +0800 Message-ID: <87v8isxpi1.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21311 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 2078 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 20:05:19 2023 Received: (at control) by debbugs.gnu.org; 12 Sep 2023 00:05:19 +0000 Received: from localhost ([127.0.0.1]:55324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfqu7-0006T3-Ee for submit@debbugs.gnu.org; Mon, 11 Sep 2023 20:05:19 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:61619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfqu6-0006Si-Hg for control@debbugs.gnu.org; Mon, 11 Sep 2023 20:05:18 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-502a25ab777so5345668e87.2 for ; Mon, 11 Sep 2023 17:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694477108; x=1695081908; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=G6EjBHKYk2x9/uWYbj2ITBmOY0yirCh2TXg3BqyMG68=; b=Zt+bXCLYCp0FCmEVM4fwQXk3mjhIsLJXA4exflposxuT0U/PnbxmYVSjt0k8CPGm1A 8NLvxE9ZB3jXLB70H/ExYrKGbYQwI9YkDknIxoqis+kzJe4R9JrPc0qyWvIeSH6n0YIN 5P82e60M7Gi313qOjJXqwYGXLhRVC+qsyF6/5LVckCRani3wN+81nRs0Da99c9d7zJk7 Ao6OZ08DQNtG8ueFXh06bYkTeu4M27BVpW2p/96dsQh3/+Ry6RjwatfZl4rjTwZBbnIx wWPXeJqPlYvzqxeKkI8QFA1rGtYV9iJFqpjclzLfnCRgDSDkN91n8p4byuzxJwvGMsGV kl1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694477108; x=1695081908; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=G6EjBHKYk2x9/uWYbj2ITBmOY0yirCh2TXg3BqyMG68=; b=FBbRJZo9Zcjr7dsMzUFsCiFdiPOn2XjNmoQtVA1W2calDK8ciuO+/Q0j40vFEEi3jv 9XGNvBV0Rsi63F4ESO/zhcQ3xBq/IOQKc9ORv+AmzOEw6mMd2bq5pm7/YeIEnldSgguK dC2/nAekqim9xgtgrKT875WJiZcUzgLpPMwGB0i+JrY87MaZvmnh9V+SkUVTpejei4K2 /z62PtcqG/dEJGAomJRIo4OBpiUvDQhiSNE7ozvk0mt1p9Q9Z/bA9GMJkcmhJqSE1Gbt qVIZ2YwmeBE1uYKF6PdqiHXorysWU/FaNTLf2ThB5/VqogPGFxKIGFoOVZKdhXq6Gjob EYnA== X-Gm-Message-State: AOJu0YwPW/vpAAsysv2RnA91IJ81+ulPZfWzlYnvCf0Ug4DvcWCcBBlA PvZuSYhOnS+OnjLN+kD5XJ9/L44eSM93IdfYhwOooWSEGhw= X-Google-Smtp-Source: AGHT+IGA4QlVK5opOTZBpsClzE+G0fR40uw2bvl+f7uqtR1V+oZ8nkek20sIsgumLk5fgZZKoBMEEMb+ovrk+QJzuPs= X-Received: by 2002:a2e:7311:0:b0:2b7:33b9:8809 with SMTP id o17-20020a2e7311000000b002b733b98809mr9019029ljc.16.1694477108214; Mon, 11 Sep 2023 17:05:08 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 11 Sep 2023 17:05:07 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 11 Sep 2023 17:05:07 -0700 Message-ID: Subject: control message for bug #62392 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 62392 + moreinfo quit From unknown Sat Jun 14 03:55:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: tomasralph2000@gmail.com Subject: bug#62392: closed (Re: bug#62392: frame-monitor-attributes fails to calculate mm-size for the monitor) Message-ID: References: X-Gnu-PR-Message: they-closed 62392 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: moreinfo Reply-To: 62392@debbugs.gnu.org Date: Mon, 23 Oct 2023 20:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1698091982-22948-1" This is a multi-part message in MIME format... ------------=_1698091982-22948-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #62392: frame-monitor-attributes fails to calculate mm-size for the monitor which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 62392@debbugs.gnu.org. --=20 62392: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62392 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1698091982-22948-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 62392-done) by debbugs.gnu.org; 23 Oct 2023 20:12:45 +0000 Received: from localhost ([127.0.0.1]:51946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv1I5-0005xY-Bw for submit@debbugs.gnu.org; Mon, 23 Oct 2023 16:12:45 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:43244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv1I2-0005xD-9u for 62392-done@debbugs.gnu.org; Mon, 23 Oct 2023 16:12:44 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c51f5a1ecdso53771511fa.0 for <62392-done@debbugs.gnu.org>; Mon, 23 Oct 2023 13:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698091927; x=1698696727; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=gJ9HcTR+oImxyxdJuIx82amZVH4zZfR0QnaxYqdge5c=; b=NEgWNxr0Ym3UFOxBAdPL2JvCzmEBDRAwN5v8z4WGTgLFcCf3LHBCpXRstx88kacmoO tfEv1WQNjVdcvu61E0uzFFclPhD4sFcIirhaomLzmtpMLbTaOW2kJBD5janEHmnHUKZb nXnXyh8UH/EIJtt5LyQd1ScxJKv2EUN2OE/mnNam8X4txEosNobByDGeMXC73YNiq1WM 608M+zpw/2M4JQ2D1cns3TGwcOAD+8/kozn0yYSiscgGn58nq5vNYBEELE9x5a/pAIdw ms9c6m3iWQzZhoX/I/jNngckeTSnCW0azAMPd1gOl8bP66nVgTFENboGZxE5uzH9/vSu FgDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698091927; x=1698696727; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gJ9HcTR+oImxyxdJuIx82amZVH4zZfR0QnaxYqdge5c=; b=qO3amdUqofIGlvCKwv9PPQ2+oGnx4yHTgj2wC8x7y0Lp8A/WFpNPNpqPd8rpWfJ2BX Gt5krT2xUXRfW1FOgVuCCgUTuNbyTPH7ZhLHHy495vxtig9O9RoXiJGPIK1lElNtcH9p 853prO7E1DNy4edArr6S2bqFwdkrXAMV7mbDhKvRY+qlj1TdDouE1TJ2HDiC4lvhHTza ZM3DVeB3Glf/1HcRaIQS7KQg9uszjm1BDafK14S5zZxsEYANkC1lFzHN7XNTQR6c5IOB tP8QvWDJtYxT83RyutLuaP3/5DN25jmwhrfuLANQ/StL7KKekUOV3kPCx5z7SeFXrGcf 1n6A== X-Gm-Message-State: AOJu0YyiKhMfTXvd5kmv+tLnkO3PKP2WXN3luKfxUlQZZHQAgO0Zp6BJ FxvQtS8IpQ245p4SV4a+12zjPce6VUB2pAjDC2A1/Yx+7CY= X-Google-Smtp-Source: AGHT+IHhhlngfsAfxNsPPuqsvXM8sj5Pl59DGHq6ErMTU9jvlsjyt11JoSafbrqBwe/3fGLVCDi2VUU/WlB1JRMkTtI= X-Received: by 2002:a05:651c:4ca:b0:2c5:7c22:c071 with SMTP id e10-20020a05651c04ca00b002c57c22c071mr1214954lji.25.1698091926953; Mon, 23 Oct 2023 13:12:06 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 23 Oct 2023 13:12:06 -0700 From: Stefan Kangas In-Reply-To: <87v8isxpi1.fsf@yahoo.com> (Po Lu's message of "Thu, 23 Mar 2023 08:47:34 +0800") References: <87v8isxpi1.fsf@yahoo.com> MIME-Version: 1.0 Date: Mon, 23 Oct 2023 13:12:06 -0700 Message-ID: Subject: Re: bug#62392: frame-monitor-attributes fails to calculate mm-size for the monitor To: Po Lu Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62392-done Cc: tomasralph2000@gmail.com, 62392-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Po Lu writes: > 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. More information was requested, but none was given within 6 months, so I'm closing this bug. If this is still an issue, please reply to this email (use "Reply to all" in your email client) and we can reopen the bug report. ------------=_1698091982-22948-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Mar 2023 20:42:59 +0000 Received: from localhost ([127.0.0.1]:36800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf5IP-0003J2-Kv for submit@debbugs.gnu.org; Wed, 22 Mar 2023 16:42:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:50772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf4Du-0001bW-Pr for submit@debbugs.gnu.org; Wed, 22 Mar 2023 15:34:15 -0400 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 1pf4Du-0000wH-6Z for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 15:34:14 -0400 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pf4Dr-0002R1-51 for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 15:34:13 -0400 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1755e639b65so20537053fac.3 for ; Wed, 22 Mar 2023 12:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679513649; h=to:subject:message-id:from:date:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4GID6M1HNBr69o6K3+sClUUR/E1Q+zXK5sD/mGPkvI0=; b=NnRcnmd5cnxVsUGXnsQEV9ocx7BQA+sHkl/IoirYvpV7PD9wTwOJoYdQtCA+ELMtLe PX4PDNVqdzOqWU5YRgsp+iHKhCa+HQ5E1qJV+oWujCTXOz6+zy11jDGgCj5IXSOKLOqy jQYx/22SEKwPAoyp5oY4ErsI4eiqNW0hauXVqKYAPDryzVSBzJW7KP4o4sty5gG0Bz3F VRwgo2/eujuxx1DSdCZxgCe82oj5l0vkv8U0iIgG9WlCB/4YS3NQrLIWUhdTslg9KVZl eLXxA20UrAOhGFoWSPPtsqstom7iVA6+9zBgydap8ciC41L3QCcTGD6g3f+08yJZ5FKs 9FBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679513649; h=to:subject:message-id:from:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4GID6M1HNBr69o6K3+sClUUR/E1Q+zXK5sD/mGPkvI0=; b=7Tvf3cTQUmRdtOXRhGC2YUsF7a7WAnTdQom7n3AChS7qKR4ciWljyv1FTAl2dF0Rzk jlxoINo5VHCjHR1Sl2Y8VLqBFRtZv8r6IYyUcCWWzsp7HMR3zwGYSY3ew4TCWV4JjYAZ 9z8hLOG8LRftj4yaVTnuR0OG23khhJ7Hmbp7hxGu1Y3FEoH8LQIumA4OW5c/yUa3oMGX LeDSBfREJN1wZF3F95lhskMYpLxaM/lfHtH3x8Aj3ABg6uikcn+L0/vsJWphzJVN4M9y MhPcjOTZuY9IpiHcwNzd8oNr4dHXGIWN+mRhb73bj8YfSX42GupBDUTWYZGqBPXOZeon JM9g== X-Gm-Message-State: AAQBX9eJnleIfv4VDYEHp8YernxcT1przOGQXE1MlapvZJLCOnZ8BcS1 ojcGlb1JZk5YnzgQWavhErsnEEAD8fk= X-Google-Smtp-Source: AKy350Z6ZJMoRUbTSWhbMpWBGVetkPknICt4HrJ9AkOIfRUDQhNS/pOPdaeUS99FjeeO/FyoTz/hzA== X-Received: by 2002:a05:6870:1d1:b0:16e:8ce5:b94 with SMTP id n17-20020a05687001d100b0016e8ce50b94mr639484oad.43.1679513649071; Wed, 22 Mar 2023 12:34:09 -0700 (PDT) Received: from rainloop.titocloud.duckdns.org ([186.189.239.39]) by smtp.gmail.com with ESMTPSA id ya9-20020a0568714cc900b001723a2e84b6sm5520302oab.6.2023.03.22.12.34.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Mar 2023 12:34:08 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 22 Mar 2023 19:35:21 +0000 Content-Type: multipart/alternative; boundary="--=_RainLoop_248_271416756.1679513721" X-Mailer: RainLoop/1.13.0 From: tomasralph2000@gmail.com Message-ID: Subject: frame-monitor-attributes fails to calculate mm-size for the monitor To: bug-gnu-emacs@gnu.org Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=tomasralph2000@gmail.com; helo=mail-oa1-x2e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 22 Mar 2023 16:42:56 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) ----=_RainLoop_248_271416756.1679513721 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Whenever I try to run tetris, or snake, or pong, I get "arithmetic overfl= ow error". After digging a bit, I found where the issue lies. This functi= on:=0A=0A (defun gamegrid-calculate-glyph-size ()=0A "Calculate appropria= te glyph size in pixels based on display resolution.=0A Return a multiple= of 8 no less than 16."=0A (let ((atts (frame-monitor-attributes))=0A y-p= itch)=0A (setq y-pitch (cond=0A (atts=0A (/ (nth 4 (assq 'geometry atts))= =0A (nth 2 (assq 'mm-size atts))=0A (or (cdr (assq 'scale-factor atts)) 1= .0)))=0A ((and (display-pixel-height) (display-mm-height))=0A (/ (display= -pixel-height) (float (display-mm-height))))))=0A (if y-pitch=0A (let* ((= pixels (* y-pitch gamegrid-glyph-height-mm))=0A (rounded (* (floor (/ (+ = pixels 4) 8)) 8)))=0A (max 16 rounded))=0A 16)))=0A=0AIs the one causing = the error. Where in particular? This section:=0A=0A (/ (nth 4 (assq 'geom= etry atts))=0A (nth 2 (assq 'mm-size atts))=0A=0AWhat'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 laptop= s, they both return proper values. This is happening on my desktop, where= it fails.=0A=0AI am using Wayland (with Hyprland) and the PGTK version o= f emacs, which likely has something to do with this. This is what `frame-= monitor-attributes` returns for me:=0A=0A ((name . "HDMI") (geometry 0 0 = 1920 1080) (workarea 0 0 1920 1080) (mm-size 0 0) (scale-factor . 1.0) (f= rames # #) (source . "Gdk"))=0A=0AAs 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.=0A=0AThis is what emacs outputs o= n 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 dotif= les repo cloned in both systems:=0A=0A ((name . "0x0335") (geometry 0 0 1= 366 768) (workarea 0 0 1366 768) (mm-size 310 170) (scale-factor . 1.0) (= frames # #) (source . "Gdk"))=0A=0AThis time, the `mm-size` gets properl= y calculated.=0A=0ASo something is funky with `frame-monitor-attributes`.= Any direction on=0Ahow I can further debug this would be appreciated.=0A= In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version=0A 3.24.= 37, cairo version 1.17.8) of 2023-03-21 built on Rainbow=0ARepository rev= ision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd=0ARepository branch: make= pkg=0ASystem Description: Arch Linux=0A=0AConfigured using:=0A 'configure= --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib=0A --localst= atedir=3D/var --mandir=3D/usr/share/man --with-gameuser=3D:games=0A --wit= h-modules --without-libotf --without-m17n-flt --without-gconf=0A --with-n= ative-compilation=3Dyes --with-native-compilation=3Daot=0A --with-xinput2= --with-pgtk --without-xaw3d --with-sound=3Dalsa=0A --with-tree-sitter --= without-gpm --without-compress-install=0A '--program-transform-name=3Ds/(= [ec]tags)/1.emacs/'=0A 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pi= pe -fno-plt -fexceptions=0A -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3D= format-security=0A -fstack-clash-protection -fcf-protection'=0A LDFLAGS= =3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'=0A=0AConfigured fea= tures:=0AACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ J= PEG JSON=0ALCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PD= UMPER PGTK=0APNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_B= ARS=0ATREE_SITTER WEBP XIM GTK3 ZLIB=0A=0AImportant settings:=0A value of= $LANG: en_US.UTF-8=0A locale-coding-system: utf-8-unix=0A=0AMajor mode: = Lisp Interaction=0A=0AMinor modes in effect:=0A which-key-mode: t=0A rece= ntf-mode: t=0A global-git-commit-mode: t=0A magit-auto-revert-mode: t=0A = shell-dirtrack-mode: t=0A override-global-mode: t=0A vertico-mouse-mode: = t=0A vertico-mode: t=0A corfu-popupinfo-mode: t=0A global-corfu-mode: t= =0A corfu-mode: t=0A pixel-scroll-precision-mode: t=0A global-display-lin= e-numbers-mode: t=0A display-line-numbers-mode: t=0A tooltip-mode: t=0A g= lobal-eldoc-mode: t=0A eldoc-mode: t=0A show-paren-mode: t=0A electric-in= dent-mode: t=0A mouse-wheel-mode: t=0A file-name-shadow-mode: t=0A global= -font-lock-mode: t=0A font-lock-mode: t=0A blink-cursor-mode: t=0A line-n= umber-mode: t=0A transient-mark-mode: t=0A auto-composition-mode: t=0A au= to-encryption-mode: t=0A auto-compression-mode: t=0A=0ALoad-path shadows:= =0A/home/tralph3/.local/share/emacs/elpa/jsonrpc-1.0.16/jsonrpc hides /us= r/share/emacs/30.0.50/lisp/jsonrpc=0A/home/tralph3/.local/share/emacs/elp= a/transient-20230304.1149/transient hides /usr/share/emacs/30.0.50/lisp/t= ransient=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.200= 4/use-package hides /usr/share/emacs/30.0.50/lisp/use-package/use-package= =0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-pa= ckage-core hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-co= re=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-= package-jump hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-= jump=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/us= e-package-bind-key hides /usr/share/emacs/30.0.50/lisp/use-package/use-pa= ckage-bind-key=0A/home/tralph3/.local/share/emacs/elpa/use-package-202302= 03.2004/use-package-delight hides /usr/share/emacs/30.0.50/lisp/use-packa= ge/use-package-delight=0A/home/tralph3/.local/share/emacs/elpa/use-packag= e-20230203.2004/use-package-diminish hides /usr/share/emacs/30.0.50/lisp/= use-package/use-package-diminish=0A/home/tralph3/.local/share/emacs/elpa/= bind-key-20230203.2004/bind-key hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/bind-key=0A/home/tralph3/.local/share/emacs/elpa/use-package-20230= 203.2004/use-package-lint hides /usr/share/emacs/30.0.50/lisp/use-package= /use-package-lint=0A/home/tralph3/.local/share/emacs/elpa/use-package-202= 30203.2004/use-package-ensure hides /usr/share/emacs/30.0.50/lisp/use-pac= kage/use-package-ensure=0A/home/tralph3/.local/share/emacs/elpa/project-0= .9.8/project hides /usr/share/emacs/30.0.50/lisp/progmodes/project=0A/hom= e/tralph3/.local/share/emacs/elpa/eglot-20221020.1010/eglot hides /usr/sh= are/emacs/30.0.50/lisp/progmodes/eglot=0A/home/tralph3/.local/share/emacs= /elpa/xref-1.6.2/xref hides /usr/share/emacs/30.0.50/lisp/progmodes/xref= =0A=0AFeatures:=0A(shadow sort mail-extr emacsbug rect pong novice shortd= oc bug-hunter=0Ahelp-fns radix-tree cl-print disp-table tetris gamegrid m= ule-util=0Amagit-bookmark bookmark time eglot array jsonrpc ert pp ewoc d= ebug=0Abacktrace find-func xref flymake-proc flymake project org-faces=0A= org-version org-macs which-key dashboard dashboard-widgets all-the-icons= =0Aall-the-icons-faces data-material data-weathericons data-octicons=0Ada= ta-fileicons data-faicons data-alltheicons recentf tree-widget=0Awid-edit= ffap orderless magit-submodule magit-obsolete magit-blame=0Amagit-stash = magit-reflog magit-bisect magit-push magit-pull magit-fetch=0Amagit-clone= magit-remote magit-commit magit-sequence magit-notes=0Amagit-worktree ma= git-tag magit-merge magit-branch magit-reset=0Amagit-files magit-refs mag= it-status magit magit-repos magit-apply=0Amagit-wip magit-log which-func = imenu magit-diff smerge-mode diff=0Adiff-mode git-commit log-edit message= sendmail yank-media puny dired=0Adired-loaddefs rfc822 mml mml-sec epa d= erived epg rfc6068 epg-config=0Agnus-util time-date mm-decode mm-bodies m= m-encode mail-parse rfc2231=0Arfc2047 rfc2045 mm-util ietf-drums mail-prs= vr mailabbrev mail-utils=0Agmm-utils mailheader pcvs-util add-log magit-c= ore magit-autorevert=0Aautorevert filenotify magit-margin magit-transient= magit-process=0Awith-editor shell pcomplete server magit-mode transient = magit-git=0Amagit-base magit-section format-spec crm dash edmacro kmacro= =0Ause-package-bind-key bind-key easy-mmode vertico-mouse vertico=0Arust-= utils thingatpt rust-mode rust-rustfmt rust-playpen rust-compile=0Acompil= e text-property-search comint ansi-osc ansi-color rust-cargo=0Akind-icon = svg-lib color svg dom xml corfu-popupinfo corfu compat=0Acompat-29 use-pa= ckage-ensure use-package-core pixel-scroll cua-base ring=0Acomp comp-cstr= warnings icons rx cl-extra help-mode display-line-numbers=0Apcase bug-hu= nter-autoloads neotree-autoloads org-bullets-autoloads=0Awhich-key-autolo= ads markdown-mode-autoloads dashboard-autoloads info=0Apackage browse-url= url url-proxy url-privacy url-expand url-methods=0Aurl-history url-cooki= e generate-lisp-file url-domsuf url-util mailcap=0Aurl-handlers url-parse= auth-source cl-seq eieio eieio-core cl-macs=0Apassword-cache json subr-x= map byte-opt gv bytecomp byte-compile=0Aurl-vars cl-loaddefs cl-lib rmc = iso-transl tooltip cconv eldoc paren=0Aelectric uniquify ediff-hook vc-ho= oks lisp-float-type elisp-mode mwheel=0Aterm/pgtk-win pgtk-win term/commo= n-win pgtk-dnd tool-bar dnd fontset=0Aimage regexp-opt fringe tabulated-l= ist replace newcomment text-mode=0Alisp-mode prog-mode register page tab-= bar menu-bar rfn-eshadow isearch=0Aeasymenu timer select scroll-bar mouse= jit-lock font-lock syntax=0Afont-core term/tty-colors frame minibuffer n= advice seq simple cl-generic=0Aindonesian philippine cham georgian utf-8-= lang misc-lang vietnamese=0Atibetan thai tai-viet lao korean japanese euc= jp-ms cp51932 hebrew greek=0Aromanian slovak czech european ethiopic indi= an cyrillic chinese=0Acomposite emoji-zwj charscript charprop case-table = epa-hook=0Ajka-cmpr-hook help abbrev obarray oclosure cl-preloaded button= loaddefs=0Atheme-loaddefs faces cus-face macroexp files window text-prop= erties=0Aoverlay sha1 md5 base64 format env code-pages mule custom widget= keymap=0Ahashtable-print-readable backquote threads dbusbind inotify=0Ad= ynamic-setting system-font-setting font-render-setting cairo gtk pgtk=0Al= cms2 multi-tty make-network-process native-compile emacs)=0A=0AMemory inf= ormation:=0A((conses 16 319167 94405)=0A (symbols 48 21107 3)=0A (strings= 32 87375 4726)=0A (string-bytes 1 3487955)=0A (vectors 16 53395)=0A (vec= tor-slots 8 1061140 40998)=0A (floats 8 774 1186)=0A (intervals 56 2980 5= 34)=0A (buffers 984 30)) ----=_RainLoop_248_271416756.1679513721 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
W= henever I try to run tetris, or snake, or pong, I get "arithmetic overflo= w error". After digging a bit, I found where the issue lies. This functio= n:

(defun gamegrid-calculate-glyph-size ()
"Calculate appropr= iate glyph size in pixels based on display resolution.
Return a multi= ple of 8 no less than 16."
(let ((atts (frame-monitor-attributes)) y-pitch)
(setq y-pitch (cond
(atts
(/ (nth 4 (assq 'geometr= y atts))
(nth 2 (assq 'mm-size atts))
(or (cdr (assq 'scale-facto= r atts)) 1.0)))
((and (display-pixel-height) (display-mm-height))
= (/ (display-pixel-height) (float (display-mm-height))))))
(if y-pitc= h
(let* ((pixels (* y-pitch gamegrid-glyph-height-mm))
(rounded (= * (floor (/ (+ pixels 4) 8)) 8)))
(max 16 rounded))
16)))

= 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 happen= ing on my desktop, where it fails.

I am using Wayland (with Hyprla= nd) and the PGTK version of emacs, which likely has something to do with = this. This is what `frame-monitor-attributes` returns for me:

((n= ame . "HDMI") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size = 0 0) (scale-factor . 1.0) (frames #<frame *scratch* - GNU Emacs at Rai= nbow 0x55799b79aa48> #<frame 0x55799d4561e0>) (source . "Gdk"))<= br>
As you can see, the `mm-size` is 0, so emacs divides by zero. Amaz= ingly, 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 `fra= me-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 confi= g for everything since I have the same dotifles repo cloned in both syste= ms:

((name . "0x0335") (geometry 0 0 1366 768) (workarea 0 0 1366= 768) (mm-size 310 170) (scale-factor . 1.0) (frames #<frame *scratch*= - GNU Emacs at T430 0x55c4c1cdad20> #<frame 0x55c4c356b7e0>) (s= ource . "Gdk"))

This time, the `mm-size` gets properly calculated.=

So something is funky with `frame-monitor-attributes`. Any direct= ion on
how I can further debug this would be appreciated.


<= br>In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3= .24.37, cairo version 1.17.8) of 2023-03-21 built on Rainbow
Repositor= y revision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd
Repository branch= : makepkg
System Description: Arch Linux

Configured using:
= 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --mandir=3D/usr/share/man --with-gameuser=3D:gam= es
--with-modules --without-libotf --without-m17n-flt --without-gconf=
--with-native-compilation=3Dyes --with-native-compilation=3Daot
= --with-xinput2 --with-pgtk --without-xaw3d --with-sound=3Dalsa
--with= -tree-sitter --without-gpm --without-compress-install
'--program-tran= sform-name=3Ds/\([ec]tags\)/\1.emacs/'
'CFLAGS=3D-march=3Dx86-64 -mtu= ne=3Dgeneric -O2 -pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=3D= 2 -Wformat -Werror=3Dformat-security
-fstack-clash-protection -fcf-pr= otection'
LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now= '

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNU= TLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATI= VE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THR= EADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Im= portant settings:
value of $LANG: en_US.UTF-8
locale-coding-syste= m: utf-8-unix

Major mode: Lisp Interaction

Minor modes in e= ffect:
which-key-mode: t
recentf-mode: t
global-git-commit-mo= de: t
magit-auto-revert-mode: t
shell-dirtrack-mode: t
overri= de-global-mode: t
vertico-mouse-mode: t
vertico-mode: t
corfu= -popupinfo-mode: t
global-corfu-mode: t
corfu-mode: t
pixel-s= croll-precision-mode: t
global-display-line-numbers-mode: t
displ= ay-line-numbers-mode: t
tooltip-mode: t
global-eldoc-mode: t
= eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mous= e-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t=
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t transient-mark-mode: t
auto-composition-mode: t
auto-encryptio= n-mode: t
auto-compression-mode: t

Load-path shadows:
/home= /tralph3/.local/share/emacs/elpa/jsonrpc-1.0.16/jsonrpc hides /usr/share/= emacs/30.0.50/lisp/jsonrpc
/home/tralph3/.local/share/emacs/elpa/trans= ient-20230304.1149/transient hides /usr/share/emacs/30.0.50/lisp/transien= t
/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-= package hides /usr/share/emacs/30.0.50/lisp/use-package/use-package
/h= ome/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-package= -core hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-core/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-pack= age-jump hides /usr/share/emacs/30.0.50/lisp/use-package/use-package-jump=
/home/tralph3/.local/share/emacs/elpa/use-package-20230203.2004/use-p= ackage-bind-key hides /usr/share/emacs/30.0.50/lisp/use-package/use-packa= ge-bind-key
/home/tralph3/.local/share/emacs/elpa/use-package-20230203= .2004/use-package-delight hides /usr/share/emacs/30.0.50/lisp/use-package= /use-package-delight
/home/tralph3/.local/share/emacs/elpa/use-package= -20230203.2004/use-package-diminish hides /usr/share/emacs/30.0.50/lisp/u= se-package/use-package-diminish
/home/tralph3/.local/share/emacs/elpa/= bind-key-20230203.2004/bind-key hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/bind-key
/home/tralph3/.local/share/emacs/elpa/use-package-2023= 0203.2004/use-package-lint hides /usr/share/emacs/30.0.50/lisp/use-packag= e/use-package-lint
/home/tralph3/.local/share/emacs/elpa/use-package-2= 0230203.2004/use-package-ensure hides /usr/share/emacs/30.0.50/lisp/use-p= ackage/use-package-ensure
/home/tralph3/.local/share/emacs/elpa/projec= t-0.9.8/project hides /usr/share/emacs/30.0.50/lisp/progmodes/project
= /home/tralph3/.local/share/emacs/elpa/eglot-20221020.1010/eglot hides /us= r/share/emacs/30.0.50/lisp/progmodes/eglot
/home/tralph3/.local/share/= emacs/elpa/xref-1.6.2/xref hides /usr/share/emacs/30.0.50/lisp/progmodes/= xref

Features:
(shadow sort mail-extr emacsbug rect pong novice= shortdoc bug-hunter
help-fns radix-tree cl-print disp-table tetris ga= megrid mule-util
magit-bookmark bookmark time eglot array jsonrpc ert = pp ewoc debug
backtrace find-func xref flymake-proc flymake project or= g-faces
org-version org-macs which-key dashboard dashboard-widgets all= -the-icons
all-the-icons-faces data-material data-weathericons data-oc= ticons
data-fileicons data-faicons data-alltheicons recentf tree-widge= t
wid-edit ffap orderless magit-submodule magit-obsolete magit-blamemagit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch=
magit-clone magit-remote magit-commit magit-sequence magit-notes
m= agit-worktree magit-tag magit-merge magit-branch magit-reset
magit-fil= es magit-refs magit-status magit magit-repos magit-apply
magit-wip mag= it-log which-func imenu magit-diff smerge-mode diff
diff-mode git-comm= it log-edit message sendmail yank-media puny dired
dired-loaddefs rfc8= 22 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util time-date = mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-ut= il ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pc= vs-util add-log magit-core magit-autorevert
autorevert=20filenotify ma= git-margin magit-transient magit-process
with-editor shell pcomplete s= erver magit-mode transient magit-git
magit-base magit-section format-s= pec crm dash edmacro kmacro
use-package-bind-key bind-key easy-mmode v= ertico-mouse vertico
rust-utils thingatpt rust-mode rust-rustfmt rust-= playpen rust-compile
compile text-property-search comint ansi-osc ansi= -color rust-cargo
kind-icon svg-lib color svg dom xml corfu-popupinfo = corfu compat
compat-29 use-package-ensure use-package-core pixel-scrol= l cua-base ring
comp comp-cstr warnings icons rx cl-extra help-mode di= splay-line-numbers
pcase bug-hunter-autoloads neotree-autoloads org-bu= llets-autoloads
which-key-autoloads markdown-mode-autoloads dashboard-= autoloads info
package browse-url url url-proxy url-privacy url-expand= url-methods
url-history url-cookie generate-lisp-file url-domsuf url-= util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-cor= e cl-macs
password-cache json subr-x map byte-opt gv bytecomp byte-com= pile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc pa= ren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode m= wheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fon= tset
image regexp-opt fringe tabulated-list replace newcomment text-mo= de
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isea= rch
easymenu timer select scroll-bar mouse jit-lock font-lock syntaxfont-core term/tty-colors frame minibuffer nadvice seq simple cl-generi= c
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese<= br>tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew gree= k
romanian slovak czech european ethiopic indian cyrillic chinese
c= omposite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-ho= ok help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loa= ddefs faces cus-face macroexp files window text-properties
overlay sha= 1 md5 base64 format env code-pages mule custom widget keymap
hashtable= -print-readable backquote threads dbusbind inotify
dynamic-setting sys= tem-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty ma= ke-network-process native-compile emacs)

Memory information:
((= conses 16 319167 94405)
(symbols 48 21107 3)
(strings 32 87375 47= 26)
(string-bytes 1 3487955)
(vectors 16 53395)
(vector-slots= 8 1061140 40998)
(floats 8 774 1186)
(intervals 56 2980 534)
= (buffers 984 30))
----=_RainLoop_248_271416756.1679513721-- ------------=_1698091982-22948-1--