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: Tue, 09 May 2023 02:08:29 +0000 Message-ID: <307a269d4093140c20db72b1b60d57f4@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--=_RainLoop_581_145265126.1683598109" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34905"; 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 Tue May 09 04:06:50 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 1pwCkb-0008t5-Do for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 May 2023 04:06:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwCk1-0000d2-RW; Mon, 08 May 2023 22:06:13 -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 1pwCjz-0000cl-9l for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:06:11 -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 1pwCjr-0006uL-DL for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:06:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwCjq-000881-Ow for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: tomasralph2000@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 May 2023 02:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63384 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168359790331162 (code B ref -1); Tue, 09 May 2023 02:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 May 2023 02:05:03 +0000 Original-Received: from localhost ([127.0.0.1]:42017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwCir-00086C-Df for submit@debbugs.gnu.org; Mon, 08 May 2023 22:05:03 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwCio-000863-7A for submit@debbugs.gnu.org; Mon, 08 May 2023 22:04:59 -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 1pwCio-0000Rx-0E for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:04:58 -0400 Original-Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwCik-0006Uc-VU for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:04:57 -0400 Original-Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3940db1c14dso20492b6e.3 for ; Mon, 08 May 2023 19:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683597893; x=1686189893; h=to:subject:message-id:from:date:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=jzp1pNcRnYZmzvULpQotIDgKN5IoNxcspr1taZD3LAY=; b=hsuLFionhOMmt7CphbiCqgReyMLFzSXShpsTpvjYeCNvGl1LZhpdN6c0/VwMFK7k3u YZKo0KO1FEA/hMWxiWT/vRAkQ+cI/cti9oh3rzmJbCm4a8/WZZl1nddcbJJGk8u8ckkx 2pWSmbHwtKKqhb/4O9KqSzpTsiwId8fhI2/QAnpbqUynm/+yPQefBcJZO1qNXFqNmMrb L1zPeqF/XzVlE06HLtVMkcT9AbnSEGqowjVLh3+VR90l9L/FBY10MWyalNypKWjBcOvj 0Wz24lLZupgXjjOcup8XtrmvUjktPlnt9QD0mNezJFRHs6Q8bZHLgiwSudOKnMK80KCx NZBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683597893; x=1686189893; h=to:subject:message-id:from:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jzp1pNcRnYZmzvULpQotIDgKN5IoNxcspr1taZD3LAY=; b=ikPnKf8TwazpBW4j77PU6ZWhfcuXW5RmnTN76p0lVFrIzDr+OaI+C1DLUiYNILFDMs 0vr2cJcczinqWSeRDb6VMI2fShSCGbYhLwsTYVo5ZAowTdvmVozeKaolwBUT5UpkL7Pf J2HHhmtB0ETyBYwVKywybtMN1QwpB8hXQUiv/aqFaBqKaF8l/oIyX52I5RXpqRfrDesL 7xxGKksIV8kVNUpdGhQZ1ul/Rig2E0QOSBQ7OAKagxnqPASCNeqtcs88SmpDrHi/OTD5 8ZR1MoYWWqJ/2xhK3c9YovAKvX+F6S6EEMIj9rNzffLDYYRKDhJAzs2ofn/i65Mfi6CG 0gJg== X-Gm-Message-State: AC+VfDzSmevIdZbjxQiEoQCRUH8be2HBUErRjfV5w8LYDjuI23Aqw1M6 QuZ9VuGqfkPPKu9DXMJH5JvM4p4OP7A= X-Google-Smtp-Source: ACHHUZ46iMjlBkAn95FLl99WMAnxhVYc913FBKHDbc1NGv2Ne4eRAqEnyJPd1YCbg9rv5dLCg5Jocg== X-Received: by 2002:a05:6808:a03:b0:389:7810:d965 with SMTP id n3-20020a0568080a0300b003897810d965mr578522oij.24.1683597892741; Mon, 08 May 2023 19:04:52 -0700 (PDT) Original-Received: from rainloop.titocloud.duckdns.org ([190.18.132.192]) by smtp.gmail.com with ESMTPSA id d18-20020a4aba92000000b00541fbbbcd31sm1192141oop.5.2023.05.08.19.04.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 May 2023 19:04:52 -0700 (PDT) X-Mailer: RainLoop/1.13.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=tomasralph2000@gmail.com; helo=mail-oi1-x22d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:261374 Archived-At: ----=_RainLoop_581_145265126.1683598109 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The functions "x-display-mm-width" and "x-display-mm-height" both return= =0A0 on Wayland, but on a specific display.=0A=0AI also have a laptop wit= h the same setup (Arch Linux on Hyprland as=0Awindow manager) and a simil= ar emacs version (I compiled both on my=0Adesktop and laptop about ~1 hou= r from each other, my laptop went=0Afirst). This problem is not present o= n my laptop.=0A=0AThese functions should return the dimensions of my disp= lay in=0Amilimiters, as one would assume. This issue is causing numerous = features=0Ato fail with an "Arithmetic Overflow Error" since at some poin= t they=0Adivide by this number, and division by 0 is problematic of cours= e.=0A=0AMost built-in games are broken (like tetris or snake) since they = depend=0Aon these functions to compute the size of the game grid.=0A=0AMo= re importantly, latex previews on org files are also broken, since=0Athey= use the value to render the images.=0A=0AIf I switch to X11 (more specif= ically, qtile) with this same setup, the=0Afunctions return proper values= , and these features are fixed.=0A=0AIf I launch emacs with the "GDK_BACK= END" environment variable set to=0A"x11" then emacs launches using xWayla= nd, and once again, the functions=0Areturn proper values and the issue is= "fixed".=0A=0AThis seems to be an issue with GTK, rather than emacs. I f= ound another=0Auser complaining about this here:=0Ahttps://discourse.gnom= e.org/t/gdk-monitor-get-width-mm-failure-wayland/5412=0A=0ASince there do= esn't seem to be much the emacs developers can do about=0Athis, I propose= a workaround is set in place.=0A=0AThe functions that return the display= size in pixels do work. Maybe=0Aemacs could check if the mm dimensions a= re being reported as 0, and try=0Ato guess appropiate values. They may be= wrong, but it's a better option=0Athan having these features outright fa= il with non-descriptive errors.=0A=0AAlternatively, since we now know tha= t these functions can return 0,=0Amaybe it's more appropiate to put a che= ck in place, and fail with a more=0Adescriptive error message.=0A=0AIn th= e thread I linked, there's a code snippet of the xorg source code=0Athat = showcases it doing exactly that. Maybe emacs could do the same.=0A=0AIt i= s likely that my monitor is the problem here (it's a cheap one). It=0Amay= not have these values properly set in its firmware. Probably Xorg=0Aisn'= t getting proper values either, and it may be relying on that code snippe= t.=0A=0AThis would also explain why it works on my laptop.=0AIn GNU Emacs= 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version=0A 3.24.37, cairo ve= rsion 1.17.8) of 2023-03-21 built on Rainbow=0ARepository revision: 42fba= 8f36b19536964d6deb6a34f3fd1c02b43dd=0ARepository branch: makepkg=0ASystem= Description: Arch Linux=0A=0AConfigured using:=0A 'configure --prefix=3D= /usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib=0A --localstatedir=3D/va= r --mandir=3D/usr/share/man --with-gameuser=3D:games=0A --with-modules --= without-libotf --without-m17n-flt --without-gconf=0A --with-native-compil= ation=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 -pipe -fno-plt = -fexceptions=0A -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-secur= ity=0A -fstack-clash-protection -fcf-protection'=0A LDFLAGS=3D-Wl,-O1,--s= ort-common,--as-needed,-z,relro,-z,now'=0A=0AConfigured features:=0AACL C= AIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON=0ALCM= S2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK=0AP= NG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS=0ATREE_SIT= TER 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 Interacti= on=0A=0AMinor modes in effect:=0A global-undo-tree-mode: t=0A undo-tree-m= ode: t=0A org-roam-db-autosync-mode: t=0A marginalia-mode: t=0A which-key= -mode: t=0A global-tree-sitter-mode: t=0A recentf-mode: t=0A treemacs-fil= ewatch-mode: t=0A treemacs-follow-mode: t=0A treemacs-git-mode: t=0A glob= al-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 xterm-mouse-mode: t=0A global-auto-reve= rt-mode: t=0A electric-pair-mode: t=0A delete-selection-mode: t=0A global= -display-line-numbers-mode: t=0A display-line-numbers-mode: t=0A tooltip-= mode: t=0A global-eldoc-mode: t=0A eldoc-mode: t=0A show-paren-mode: t=0A= electric-indent-mode: t=0A mouse-wheel-mode: t=0A file-name-shadow-mode:= t=0A context-menu-mode: t=0A global-font-lock-mode: t=0A font-lock-mode:= t=0A blink-cursor-mode: t=0A line-number-mode: t=0A transient-mark-mode:= t=0A auto-composition-mode: t=0A auto-encryption-mode: t=0A auto-compres= sion-mode: t=0A=0ALoad-path shadows:=0A/home/tralph3/.local/share/emacs/e= lpa/transient-20230501.1034/transient hides /usr/share/emacs/30.0.50/lisp= /transient=0A=0AFeatures:=0A(shadow sort mail-extr emacsbug mule-util tre= emacs-bookmarks=0Atreemacs-tags magit-bookmark bookmark time org-tempo te= mpo eglot=0Aexternal-completion array ert ewoc debug backtrace jsonrpc xr= ef=0Aflymake-proc flymake project undo-tree queue org-superstar org-roam-= ui=0Aorg-roam-dailies websocket bindat org-roam-migrate org-roam-log=0Aor= g-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db=0Aemac= sql-sqlite-builtin sqlite org-roam-utils org-roam-compat org-roam=0Aorg-c= apture org-element org-persist xdg avl-tree generator org-attach=0Aorg-id= org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp=0Aorg-macro or= g-src ob-comint org-pcomplete org-list org-footnote=0Aorg-faces org-entit= ies noutline outline ob-emacs-lisp ob-core ob-eval=0Aorg-cycle org-table = ol org-fold org-fold-core org-keys oc org-loaddefs=0Afind-func cal-menu c= alendar cal-loaddefs org-version org-compat org-macs=0Aemacsql-sqlite ema= csql-sqlite-common emacsql emacsql-compiler=0Asimple-httpd marginalia whi= ch-key tree-sitter-langs=0Atree-sitter-langs-build tar-mode arc-mode arch= ive-mode pp tree-sitter-hl=0Atree-sitter tree-sitter-load tree-sitter-cli= tsc tsc-dyn tsc-dyn-get=0Adired-aux tsc-obsolete dashboard dashboard-wid= gets recentf tree-widget=0Awid-edit ffap treemacs treemacs-header-line tr= eemacs-compatibility=0Atreemacs-mode treemacs-interface treemacs-persiste= nce=0Atreemacs-filewatch-mode treemacs-follow-mode treemacs-rendering=0At= reemacs-annotations treemacs-async treemacs-workspaces treemacs-dom=0Atre= emacs-visuals treemacs-fringe-indicator pulse treemacs-faces=0Atreemacs-i= cons treemacs-scope treemacs-themes treemacs-core-utils=0Apfuture inline = hl-line ht treemacs-logging treemacs-customization=0Atreemacs-macros s or= derless magit-submodule magit-blame magit-stash=0Amagit-reflog magit-bise= ct magit-push magit-pull magit-fetch magit-clone=0Amagit-remote magit-com= mit magit-sequence magit-notes magit-worktree=0Amagit-tag magit-merge mag= it-branch magit-reset magit-files magit-refs=0Amagit-status magit magit-r= epos magit-apply magit-wip magit-log=0Awhich-func imenu magit-diff smerge= -mode diff diff-mode git-commit=0Alog-edit message sendmail yank-media pu= ny dired dired-loaddefs rfc822=0Amml mml-sec epa derived epg rfc6068 epg-= config gnus-util time-date=0Amm-decode mm-bodies mm-encode mail-parse rfc= 2231 rfc2047 rfc2045 mm-util=0Aietf-drums mail-prsvr mailabbrev mail-util= s gmm-utils mailheader=0Apcvs-util add-log magit-core magit-autorevert ma= git-margin=0Amagit-transient magit-process with-editor shell pcomplete se= rver=0Amagit-mode transient magit-git magit-base magit-section format-spe= c=0Acursor-sensor crm dash edmacro kmacro use-package-bind-key bind-key= =0Aeasy-mmode vertico-mouse vertico rust-utils thingatpt rust-mode=0Arust= -rustfmt rust-playpen rust-compile compile text-property-search=0Acomint = ansi-osc ansi-color rust-cargo kind-icon svg-lib color svg dom=0Axml corf= u-popupinfo corfu compat all-the-icons all-the-icons-faces=0Adata-materia= l data-weathericons data-octicons data-fileicons=0Adata-faicons data-allt= heicons use-package-ensure use-package-core=0Apixel-scroll cua-base ring = xt-mouse autorevert filenotify elec-pair=0Adelsel comp comp-cstr warnings= icons rx cl-extra help-mode=0Adisplay-line-numbers magit-autoloads pcase= tree-sitter-langs-autoloads=0Aall-the-icons-autoloads corfu-autoloads ki= nd-icon-autoloads=0Asvg-lib-autoloads which-key-autoloads org-superstar-a= utoloads=0Agit-commit-autoloads with-editor-autoloads vertico-autoloads= =0Atreemacs-autoloads cfrs-autoloads posframe-autoloads hydra-autoloads= =0Apfuture-autoloads ace-window-autoloads s-autoloads rust-mode-autoloads= =0Alv-autoloads undo-tree-autoloads org-roam-ui-autoloads=0Awebsocket-aut= oloads simple-httpd-autoloads org-roam-autoloads=0Amagit-section-autoload= s ht-autoloads dash-autoloads dashboard-autoloads=0Amarginalia-autoloads = avy-autoloads queue-autoloads transient-autoloads=0Acompat-autoloads emac= sql-autoloads info orderless-autoloads=0Atree-sitter-autoloads tsc-autolo= ads realgud-autoloads=0Arealgud-recursive-autoloads test-simple-autoloads= loc-changes-autoloads=0Aload-relative-autoloads package browse-url url u= rl-proxy url-privacy=0Aurl-expand url-methods url-history url-cookie gene= rate-lisp-file=0Aurl-domsuf url-util mailcap url-handlers url-parse auth-= source cl-seq=0Aeieio eieio-core cl-macs password-cache json subr-x map b= yte-opt gv=0Abytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-tr= ansl tooltip=0Acconv eldoc paren electric uniquify ediff-hook vc-hooks li= sp-float-type=0Aelisp-mode mwheel term/pgtk-win pgtk-win term/common-win = pgtk-dnd=0Atool-bar dnd fontset image regexp-opt fringe tabulated-list re= place=0Anewcomment text-mode lisp-mode prog-mode register page tab-bar me= nu-bar=0Arfn-eshadow isearch easymenu timer select scroll-bar mouse jit-l= ock=0Afont-lock syntax font-core term/tty-colors frame minibuffer nadvice= seq=0Asimple cl-generic indonesian philippine cham georgian utf-8-lang= =0Amisc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-m= s=0Acp51932 hebrew greek romanian slovak czech european ethiopic indian= =0Acyrillic chinese composite emoji-zwj charscript charprop case-table=0A= epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button= =0Aloaddefs theme-loaddefs faces cus-face macroexp files window=0Atext-pr= operties overlay sha1 md5 base64 format env code-pages mule=0Acustom widg= et keymap hashtable-print-readable backquote threads dbusbind=0Ainotify d= ynamic-setting system-font-setting font-render-setting cairo=0Agtk pgtk l= cms2 multi-tty make-network-process native-compile emacs)=0A=0AMemory inf= ormation:=0A((conses 16 397011 511676)=0A (symbols 48 30258 126)=0A (stri= ngs 32 115820 52200)=0A (string-bytes 1 4250573)=0A (vectors 16 67268)=0A= (vector-slots 8 1303883 755007)=0A (floats 8 814 2552)=0A (intervals 56 = 1037 529)=0A (buffers 984 17)) ----=_RainLoop_581_145265126.1683598109 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
T= he functions "x-display-mm-width" and "x-display-mm-height" both return0 on Wayland, but on a specific display.

I also have a laptop wi= th the same setup (Arch Linux on Hyprland as
window manager) and a sim= ilar emacs version (I compiled both on my
desktop and laptop about ~1 = hour from each other, my laptop went
first). This problem is not prese= nt on my laptop.

These functions should return the dimensions of m= y display in
milimiters, as one would assume. This issue is causing nu= merous features
to fail with an "Arithmetic Overflow Error" since at s= ome point they
divide by this number, and division by 0 is problematic= of course.

Most built-in games are broken (like tetris or snake) = since they depend
on these functions to compute the size of the game g= rid.

More importantly, latex previews on org files are also broken= , since
they use the value to render the images.

If I switch to= X11 (more specifically, qtile) with this same setup, the
functions re= turn proper values, and these features are fixed.

If I launch emac= s with the "GDK_BACKEND" environment variable set to
"x11" then emacs = launches using xWayland, and once again, the functions
return proper v= alues and the issue is "fixed".

This seems to be an issue with GTK= , rather than emacs. I found another
user complaining about this here:=
https://discourse.gnome.org/t/gdk-monitor-get-width-mm-failure-waylan= d/5412

Since there doesn't seem to be much the emacs developers ca= n do about
this, I propose a workaround is set in place.

The fu= nctions that return the display size in pixels do work. Maybe
emacs co= uld check if the mm dimensions are being reported as 0, and try
to gue= ss appropiate values. They may be wrong, but it's a better option
than= having these features outright fail with non-descriptive errors.

= Alternatively, since we now know that these functions can return 0,
ma= ybe it's more appropiate to put a check in place, and fail with a moredescriptive error message.

In the thread I linked, there's a code= snippet of the xorg source code
that showcases it doing exactly that.= Maybe emacs could do the same.

It is likely that my monitor is th= e problem here (it's a cheap one). It
may not have these values proper= ly set in its firmware. Probably Xorg
isn't getting proper values eith= er, and it may be relying on that code snippet.

This would also ex= plain why it works on my laptop.


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
Repository revision: 42fba8f36b19536964d6= deb6a34f3fd1c02b43dd
Repository branch: makepkg
System Description:= Arch Linux

Configured using:
'configure --prefix=3D/usr --sys= confdir=3D/etc --libexecdir=3D/usr/lib
--localstatedir=3D/var --mandi= r=3D/usr/share/man --with-gameuser=3D:games
--with-modules --without-= libotf --without-m17n-flt --without-gconf
--with-native-compilation= =3Dyes --with-native-compilation=3Daot
--with-xinput2 --with-pgtk --w= ithout-xaw3d --with-sound=3Dalsa
--with-tree-sitter --without-gpm --w= ithout-compress-install
'--program-transform-name=3Ds/\([ec]tags\)/\1= .emacs/'
'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-pl= t -fexceptions
-Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-se= curity
-fstack-clash-protection -fcf-protection'
LDFLAGS=3D-Wl,-O= 1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:<= br>ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JS= ON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER= PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS<= br>TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
value of= $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mod= e: Lisp Interaction

Minor modes in effect:
global-undo-tree-mo= de: t
undo-tree-mode: t
org-roam-db-autosync-mode: t
marginal= ia-mode: t
which-key-mode: t
global-tree-sitter-mode: t
recen= tf-mode: t
treemacs-filewatch-mode: t
treemacs-follow-mode: t
= treemacs-git-mode: t
global-git-commit-mode: t
magit-auto-revert= -mode: t
shell-dirtrack-mode: t
override-global-mode: t
verti= co-mouse-mode: t
vertico-mode: t
corfu-popupinfo-mode: t
glob= al-corfu-mode: t
corfu-mode: t
pixel-scroll-precision-mode: t
= xterm-mouse-mode: t
global-auto-revert-mode: t
electric-pair-mod= e: t
delete-selection-mode: t
global-display-line-numbers-mode: t=
display-line-numbers-mode: t
tooltip-mode: t
global-eldoc-mo= de: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: = t
mouse-wheel-mode: t
file-name-shadow-mode: t
context-menu-m= ode: t
global-font-lock-mode: t
font-lock-mode: t
blink-curso= r-mode: t
line-number-mode: t
transient-mark-mode: t
auto-com= position-mode: t
auto-encryption-mode: t
auto-compression-mode: t=

Load-path shadows:
/home/tralph3/.local/share/emacs/elpa/trans= ient-20230501.1034/transient hides /usr/share/emacs/30.0.50/lisp/transien= t

Features:
(shadow sort mail-extr emacsbug mule-util treemacs-= bookmarks
treemacs-tags magit-bookmark bookmark time org-tempo tempo e= glot
external-completion array ert ewoc debug backtrace jsonrpc xrefflymake-proc flymake project undo-tree queue org-superstar org-roam-ui<= br>org-roam-dailies websocket bindat org-roam-migrate org-roam-log
org= -roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db
emac= sql-sqlite-builtin sqlite org-roam-utils org-roam-compat org-roam
org-= capture org-element org-persist xdg avl-tree generator org-attach
org-= id org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro= org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-e= ntities noutline outline ob-emacs-lisp ob-core ob-eval
org-cycle org-t= able ol org-fold org-fold-core org-keys oc org-loaddefs
find-func cal-= menu calendar cal-loaddefs org-version org-compat org-macs
emacsql-sql= ite emacsql-sqlite-common emacsql emacsql-compiler
simple-httpd margin= alia which-key tree-sitter-langs
tree-sitter-langs-build tar-mode arc-= mode archive-mode pp tree-sitter-hl
tree-sitter tree-sitter-load tree-= sitter-cli tsc tsc-dyn tsc-dyn-get
dired-aux tsc-obsolete dashboard da= shboard-widgets recentf tree-widget
wid-edit ffap treemacs treemacs-he= ader-line treemacs-compatibility
treemacs-mode treemacs-interface tree= macs-persistence
treemacs-filewatch-mode treemacs-follow-mode treemacs= -rendering
treemacs-annotations treemacs-async treemacs-workspaces tre= emacs-dom
treemacs-visuals treemacs-fringe-indicator pulse treemacs-fa= ces
treemacs-icons treemacs-scope treemacs-themes treemacs-core-utils<= br>pfuture inline hl-line ht treemacs-logging treemacs-customization
t= reemacs-macros s orderless magit-submodule magit-blame magit-stash
mag= it-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
m= agit-remote magit-commit magit-sequence magit-notes magit-worktree
mag= it-tag magit-merge magit-branch magit-reset magit-files magit-refs
mag= it-status magit magit-repos magit-apply magit-wip magit-log
which-func= imenu magit-diff smerge-mode diff diff-mode git-commit
log-edit messa= ge sendmail yank-media puny dired dired-loaddefs rfc822
mml mml-sec ep= a derived epg rfc6068 epg-config gnus-util time-date
mm-decode mm-bodi= es mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mai= l-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log m= agit-core magit-autorevert magit-margin
magit-transient magit-process = with-editor shell pcomplete server
magit-mode transient magit-git magi= t-base magit-section format-spec
cursor-sensor crm dash edmacro kmacro= use-package-bind-key bind-key
easy-mmode vertico-mouse=20vertico rust= -utils thingatpt rust-mode
rust-rustfmt rust-playpen rust-compile comp= ile text-property-search
comint ansi-osc ansi-color rust-cargo kind-ic= on svg-lib color svg dom
xml corfu-popupinfo corfu compat all-the-icon= s all-the-icons-faces
data-material data-weathericons data-octicons da= ta-fileicons
data-faicons data-alltheicons use-package-ensure use-pack= age-core
pixel-scroll cua-base ring xt-mouse autorevert filenotify ele= c-pair
delsel comp comp-cstr warnings icons rx cl-extra help-mode
d= isplay-line-numbers magit-autoloads pcase tree-sitter-langs-autoloads
= all-the-icons-autoloads corfu-autoloads kind-icon-autoloads
svg-lib-au= toloads which-key-autoloads org-superstar-autoloads
git-commit-autoloa= ds with-editor-autoloads vertico-autoloads
treemacs-autoloads cfrs-aut= oloads posframe-autoloads hydra-autoloads
pfuture-autoloads ace-window= -autoloads s-autoloads rust-mode-autoloads
lv-autoloads undo-tree-auto= loads org-roam-ui-autoloads
websocket-autoloads simple-httpd-autoloads= org-roam-autoloads
magit-section-autoloads ht-autoloads dash-autoload= s dashboard-autoloads
marginalia-autoloads avy-autoloads queue-autoloa= ds transient-autoloads
compat-autoloads emacsql-autoloads info orderle= ss-autoloads
tree-sitter-autoloads tsc-autoloads realgud-autoloads
= realgud-recursive-autoloads test-simple-autoloads loc-changes-autoloadsload-relative-autoloads package browse-url url url-proxy url-privacyurl-expand url-methods url-history url-cookie generate-lisp-file
url-= domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eiei= o eieio-core cl-macs password-cache json subr-x map byte-opt gv
byteco= mp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cco= nv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
e= lisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
tool-= bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomm= ent text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-e= shadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lo= ck syntax font-core term/tty-colors frame minibuffer nadvice seq
simpl= e cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang = vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 = hebrew greek romanian slovak czech european ethiopic indian
cyrillic c= hinese composite emoji-zwj charscript charprop case-table
epa-hook jka= -cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs t= heme-loaddefs faces cus-face macroexp files window
text-properties ove= rlay sha1 md5 base64 format env code-pages mule
custom widget keymap h= ashtable-print-readable backquote threads dbusbind
inotify dynamic-set= ting system-font-setting font-render-setting cairo
gtk pgtk lcms2 mult= i-tty make-network-process native-compile emacs)

Memory informatio= n:
((conses 16 397011 511676)
(symbols 48 30258 126)
(strings = 32 115820 52200)
(string-bytes 1 4250573)
(vectors 16 67268)
= (vector-slots 8 1303883 755007)
(floats 8 814 2552)
(intervals 56= 1037 529)
(buffers 984 17))


= ----=_RainLoop_581_145265126.1683598109--