From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34680: Display monitor frames not warmed up Date: Tue, 19 Mar 2019 23:43:34 +0200 Organization: LINKOV.NET Message-ID: <87r2b2ee0p.fsf@mail.linkov.net> References: <875zt5ueue.fsf@mail.linkov.net> <87y35zfwni.fsf@mail.linkov.net> <871s3mtkrg.fsf@mail.linkov.net> <87r2bl5c37.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="193345"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 34680-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 19 22:47:00 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6MZW-000o7p-48 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 22:46:58 +0100 Original-Received: from localhost ([127.0.0.1]:37974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6MZV-0008VA-5b for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 17:46:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6MZO-0008Ut-4x for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 17:46:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6MZM-00073s-Cb for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 17:46:49 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6MXe-0006OI-9f for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 17:46:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h6MXd-0006RL-W3 for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 17:45:02 -0400 Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Mar 2019 21:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 34680 X-GNU-PR-Package: emacs Mail-Followup-To: 34680@debbugs.gnu.org, juri@linkov.net, juri@linkov.net Original-Received: via spool by 34680-done@debbugs.gnu.org id=D34680.155303185024670 (code D ref 34680); Tue, 19 Mar 2019 21:45:01 +0000 Original-Received: (at 34680-done) by debbugs.gnu.org; 19 Mar 2019 21:44:10 +0000 Original-Received: from localhost ([127.0.0.1]:50990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6MWo-0006Pp-8P for submit@debbugs.gnu.org; Tue, 19 Mar 2019 17:44:10 -0400 Original-Received: from firebrick.maple.relay.mailchannels.net ([23.83.214.59]:51850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6MWj-0006Pe-JL for 34680-done@debbugs.gnu.org; Tue, 19 Mar 2019 17:44:06 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 36C695C4C77 for <34680-done@debbugs.gnu.org>; Tue, 19 Mar 2019 21:44:04 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a70.g.dreamhost.com (unknown [100.96.11.48]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E64985C3B65 for <34680-done@debbugs.gnu.org>; Tue, 19 Mar 2019 21:44:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a70.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 19 Mar 2019 21:44:04 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Desert-Tart: 6b2eb7ec3794fdb3_1553031844030_1517361205 X-MC-Loop-Signature: 1553031844030:123699055 X-MC-Ingress-Time: 1553031844030 Original-Received: from pdx1-sub0-mail-a70.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a70.g.dreamhost.com (Postfix) with ESMTP id 8C17580639 for <34680-done@debbugs.gnu.org>; Tue, 19 Mar 2019 14:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=05I9hy riNvFHMiDPUmOrv4Igxtk=; b=EvvEu/cy/5Pekvzzsgzpou+5E8oMS/S4m9tYPO UX1bU6eA4J0GDK8L68TzfHdNUvuP9QtrvfBjyUPtely7ZQUBAftWLMd3WIfc7M1F uEAAFMrTvJWy/t6Kz8B7ptuzQJV0Ca3Hc3GQxJ/Wato1y91ChujRmQau3ag7Xq6g HnGLs= Original-Received: from mail.jurta.org (m91-129-106-13.cust.tele2.ee [91.129.106.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a70.g.dreamhost.com (Postfix) with ESMTPSA id 431E28063C for <34680-done@debbugs.gnu.org>; Tue, 19 Mar 2019 14:44:01 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a70 In-Reply-To: <87r2bl5c37.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 05 Mar 2019 23:28:00 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrieeggdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepghhnuhdrohhrghenucfkphepledurdduvdelrddutdeirddufeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirddufedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefgeeikedtqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156523 Archived-At: >>>> I guess calling the function =E2=80=98message=E2=80=99 before callin= g >>>> =E2=80=98display-monitor-attributes-list=E2=80=99 performs some redi= splay that adds >>>> the frame to the list of frames in =E2=80=98display-monitor-attribut= es-list=E2=80=99. >>> >>> It also fixes the issue when using any of the following >>> =E2=80=98redisplay=E2=80=99, =E2=80=98redraw-display=E2=80=99, =E2=80= =98redraw-frame=E2=80=99, or just >>> =E2=80=98display-monitor-attributes-list=E2=80=99 before calling >>> =E2=80=98frame-monitor-attributes=E2=80=99 for the first time. >>> >>> Just calling =E2=80=98display-monitor-attributes-list=E2=80=99 someho= w =E2=80=9Cregisters=E2=80=9D the >>> frame in the list of frames, so the next call of =E2=80=98display-mon= itor-attributes-list=E2=80=99 >>> returns the attribute =E2=80=98frames=E2=80=99 containing the frame. >> >> I can't explain this, but this is the minimal patch that fixes my >> problem. This dry run by calling gdk_display_get_monitor_at_window >> ignores its first wrong return value, so its subsequent calls return >> correct values. > > I discovered this is a known problem yet unfixed for many years: > > https://debbugs.gnu.org/19706 > 25.0.50; (+ nil nil -1) in desktop-restore-frameset As a last resort, I installed this patch as panacea for all such bugs: diff --git a/lisp/frame.el b/lisp/frame.el index c5802e30b6..7cfe546ca6 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1696,7 +1696,10 @@ frame-monitor-attributes (or frame (setq frame (selected-frame))) (cl-loop for attributes in (display-monitor-attributes-list frame) for frames =3D (cdr (assq 'frames attributes)) - if (memq frame frames) return attributes)) + if (memq frame frames) return attributes + ;; On broken frames monitor attributes, + ;; fall back to the last monitor. + finally return attributes)) =20 (defun frame-monitor-attribute (attribute &optional frame x y) "Return the value of ATTRIBUTE on FRAME's monitor.