From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 27 16:02:47 2019 Received: (at submit) by debbugs.gnu.org; 27 Feb 2019 21:02:47 +0000 Received: from localhost ([127.0.0.1]:54421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz6Lm-0004rT-Mz for submit@debbugs.gnu.org; Wed, 27 Feb 2019 16:02:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz6Ll-0004rD-GR for submit@debbugs.gnu.org; Wed, 27 Feb 2019 16:02:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:54826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gz6Lg-0007Rd-9j for submit@debbugs.gnu.org; Wed, 27 Feb 2019 16:02:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz6Lf-0003G6-Dc for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2019 16:02:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gz6Ld-0007Oq-F6 for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2019 16:02:38 -0500 Received: from firebrick.maple.relay.mailchannels.net ([23.83.214.59]:53530) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gz6Lb-0007Lf-9x for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2019 16:02:37 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AADAE500621 for ; Wed, 27 Feb 2019 21:02:33 +0000 (UTC) Received: from pdx1-sub0-mail-a65.g.dreamhost.com (unknown [100.96.20.153]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6C4B5502B5D for ; Wed, 27 Feb 2019 21:02:33 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a65.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.16.3); Wed, 27 Feb 2019 21:02:33 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Ruddy-Fearful: 2cd99f8b4e535bb0_1551301353555_2827261797 X-MC-Loop-Signature: 1551301353555:177689092 X-MC-Ingress-Time: 1551301353555 Received: from pdx1-sub0-mail-a65.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTP id 0B04C8199E for ; Wed, 27 Feb 2019 13:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=linkov.net; bh=NX3gLvEEQYSMqSFH+4f UVSxiLQs=; b=Bs10jvGs8WeBo76rzEbJLInp13R4KfJ7ir9gBtg/b94yE3vmsqQ eOhV3b7+yvO1rOJA8o/AeXQGbNl+NUdNByseridlzJ9NBbN+qspBKIFkraBMZck6 F/4hupSeKWliYi38F+xh+lercDpE49QMFPlCDJFyTSmXiqqxaqkzleE4= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (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-a65.g.dreamhost.com (Postfix) with ESMTPSA id 7100D81908 for ; Wed, 27 Feb 2019 13:02:30 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a65 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Display monitor frames not warmed up Organization: LINKOV.NET Date: Wed, 27 Feb 2019 23:02:09 +0200 Message-ID: <875zt5ueue.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrvddugddugeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohffkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.59 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit 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: -0.1 (/) Sometimes desktop restoration fails with the error: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil= ) +(nil nil -1) frameset-move-onscreen(# t) frameset--restore-frame(... t) frameset-restore([frameset ...] :reuse-frames t :cleanup-frames t :forc= e-display t :force-onscreen t) desktop-restore-frameset() desktop-read() run-hooks(after-init-hook delayed-warnings-hook) command-line() normal-top-level() because =E2=80=98frame-monitor-attributes=E2=80=99 in =E2=80=98frameset-m= ove-onscreen=E2=80=99 returns =E2=80=98nil=E2=80=99. It returns =E2=80=98nil=E2=80=99 because the attribute =E2=80=98frames=E2= =80=99 returned by =E2=80=98display-monitor-attributes-list=E2=80=99 is empty, and =E2=80=98= frame-monitor-attributes=E2=80=99 filters out the returned attributes if it can't find the arg =E2=80=98fra= me=E2=80=99 in the list of frames. However, when =E2=80=98display-monitor-attributes-list=E2=80=99 is =E2=80= =9Cwarmed up=E2=80=9D with just a =E2=80=98message=E2=80=99 call before its first call, its returned =E2=80= =98frames=E2=80=99 contains the arg =E2=80=98frame=E2=80=99. I guess calling the function =E2=80=98message=E2=80=99 before calling =E2= =80=98display-monitor-attributes-list=E2=80=99 performs some redisplay that adds the frame to the list of frames in =E2=80=98display-monitor-attributes-list=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 16:13:50 2019 Received: (at 34680) by debbugs.gnu.org; 28 Feb 2019 21:13:50 +0000 Received: from localhost ([127.0.0.1]:55582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzT02-0000Zo-7m for submit@debbugs.gnu.org; Thu, 28 Feb 2019 16:13:50 -0500 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:37877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzSzz-0000Ze-Q9 for 34680@debbugs.gnu.org; Thu, 28 Feb 2019 16:13:48 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 942F7123353 for <34680@debbugs.gnu.org>; Thu, 28 Feb 2019 21:13:46 +0000 (UTC) Received: from pdx1-sub0-mail-a27.g.dreamhost.com (unknown [100.96.35.41]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4C897124C5C for <34680@debbugs.gnu.org>; Thu, 28 Feb 2019 21:13:46 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a27.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.16.3); Thu, 28 Feb 2019 21:13:46 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wipe-Vacuous: 144d1506531051b7_1551388426403_1478706123 X-MC-Loop-Signature: 1551388426403:883566437 X-MC-Ingress-Time: 1551388426402 Received: from pdx1-sub0-mail-a27.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTP id 5A49A7F1BE for <34680@debbugs.gnu.org>; Thu, 28 Feb 2019 13:13:45 -0800 (PST) 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=Pdy6q/ qnxgUh3ihFzpb7uXsVLgE=; b=uJHBC61UP9iJNEE227KDnc1sO+FmLuOE6azVTD K3JuY2KKRcM+5E9qgoqHIMI4WMSyrOg8TpvGgWNDHvVVLf3ZCHesy0/V9EPItxAJ 2cxv/qu/B1s4COvupXE9HloWy4EbPVEksXk1bYs37XCwQZz5egRPu1BZwKmPP+4e VFGms= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (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-a27.g.dreamhost.com (Postfix) with ESMTPSA id 509207F1B5 for <34680@debbugs.gnu.org>; Thu, 28 Feb 2019 13:13:42 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a27 From: Juri Linkov To: 34680@debbugs.gnu.org Subject: Re: bug#34680: Display monitor frames not warmed up Organization: LINKOV.NET References: <875zt5ueue.fsf@mail.linkov.net> Date: Thu, 28 Feb 2019 23:09:05 +0200 In-Reply-To: <875zt5ueue.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 27 Feb 2019 23:02:09 +0200") Message-ID: <87y35zfwni.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrvdefgdduhedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefgeeikedtseguvggssghughhsrdhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgepvd Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34680 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 (-) > I guess calling the function =E2=80=98message=E2=80=99 before calling > =E2=80=98display-monitor-attributes-list=E2=80=99 performs some redispl= ay that adds > the frame to the list of frames in =E2=80=98display-monitor-attributes-= 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=98r= edraw-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 somehow =E2= =80=9Cregisters=E2=80=9D the frame in the list of frames, so the next call of =E2=80=98display-monitor= -attributes-list=E2=80=99 returns the attribute =E2=80=98frames=E2=80=99 containing the frame. This is not a real patch, it only demonstrates what changes can fix this issue: diff --git a/lisp/frameset.el b/lisp/frameset.el index ac034ec82a..18fed46e97 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -879,7 +879,11 @@ frameset-move-onscreen When forced onscreen, frames wider than the monitor's workarea are conve= rted to fullwidth, and frames taller than the workarea are converted to fullh= eight. NOTE: This only works for non-iconified frames." + ;; (redisplay) + ;; (redraw-display) + ;; (redraw-frame) + (display-monitor-attributes-list frame) (pcase-let* ((`(,left ,top ,width ,height) (cl-cdadr (frame-monitor-at= tributes frame))) (right (+ left width -1)) (bottom (+ top height -1)) (fr-left (frameset-compute-pos (frame-parameter frame 'left) lef= t right)) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 16:25:12 2019 Received: (at 34680) by debbugs.gnu.org; 4 Mar 2019 21:25:13 +0000 Received: from localhost ([127.0.0.1]:60302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0v5E-0000dq-Ki for submit@debbugs.gnu.org; Mon, 04 Mar 2019 16:25:12 -0500 Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:17611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0v5B-0000df-SJ for 34680@debbugs.gnu.org; Mon, 04 Mar 2019 16:25:11 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8BFD23E4E73 for <34680@debbugs.gnu.org>; Mon, 4 Mar 2019 21:25:08 +0000 (UTC) Received: from pdx1-sub0-mail-a28.g.dreamhost.com (unknown [100.96.24.101]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 30F873E4D4A for <34680@debbugs.gnu.org>; Mon, 4 Mar 2019 21:25:08 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a28.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.16.3); Mon, 04 Mar 2019 21:25:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Left: 065fa44662828f6d_1551734708344_3535444768 X-MC-Loop-Signature: 1551734708344:383620149 X-MC-Ingress-Time: 1551734708319 Received: from pdx1-sub0-mail-a28.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a28.g.dreamhost.com (Postfix) with ESMTP id 030B68052E for <34680@debbugs.gnu.org>; Mon, 4 Mar 2019 13:25:07 -0800 (PST) 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=OaaYlW 1+VdKJMZ9NXMgaw7miUHI=; b=bX8JwJdLQulNw6FDv6bBj9ThG45qMnnPmwUzPr vha1gPg55PQHb8PmXC/Zbtcasv5iLfSrXUqnxJLqm8yJqMDc8kU61Ep16J3TYADE b7/SxU9BDwwQnFfXb7PsUg+ofNX0DALlEGgvCJhxDWJS5kXOyC57RhDGhJR0w1iZ NQvCA= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (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-a28.g.dreamhost.com (Postfix) with ESMTPSA id 1C2C98052B for <34680@debbugs.gnu.org>; Mon, 4 Mar 2019 13:25:00 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a28 From: Juri Linkov To: 34680@debbugs.gnu.org Subject: Re: bug#34680: Display monitor frames not warmed up Organization: LINKOV.NET References: <875zt5ueue.fsf@mail.linkov.net> <87y35zfwni.fsf@mail.linkov.net> Date: Mon, 04 Mar 2019 23:03:31 +0200 In-Reply-To: <87y35zfwni.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 28 Feb 2019 23:09:05 +0200") Message-ID: <871s3mtkrg.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrfedugddugeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefgeeikedtseguvggssghughhsrdhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34680 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 (-) >> I guess calling the function =E2=80=98message=E2=80=99 before calling >> =E2=80=98display-monitor-attributes-list=E2=80=99 performs some redisp= lay that adds >> the frame to the list of frames in =E2=80=98display-monitor-attributes= -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=98= redraw-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 somehow = =E2=80=9Cregisters=E2=80=9D the > frame in the list of frames, so the next call of =E2=80=98display-monit= or-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. diff --git a/src/xfns.c b/src/xfns.c index a627b7e19e..9096595625 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4943,6 +4943,7 @@ Internal use only, use `display-monitor-attributes-= list' instead. */) && !FRAME_TOOLTIP_P (f)) { GdkWindow *gwin =3D gtk_widget_get_window (FRAME_GTK_WIDGET (f)); + gdk_display_get_monitor_at_window (gdpy, gwin); =20 #if GTK_CHECK_VERSION (3, 22, 0) for (i =3D 0; i < n_monitors; i++) From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 05 17:14:54 2019 Received: (at 34680) by debbugs.gnu.org; 5 Mar 2019 22:14:54 +0000 Received: from localhost ([127.0.0.1]:33553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1IKs-0003N8-07 for submit@debbugs.gnu.org; Tue, 05 Mar 2019 17:14:54 -0500 Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:31347) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1IKq-0003Mz-8o for 34680@debbugs.gnu.org; Tue, 05 Mar 2019 17:14:53 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CECE5284B73 for <34680@debbugs.gnu.org>; Tue, 5 Mar 2019 22:14:50 +0000 (UTC) Received: from pdx1-sub0-mail-a46.g.dreamhost.com (unknown [100.96.26.217]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7CC3D284B6D for <34680@debbugs.gnu.org>; Tue, 5 Mar 2019 22:14:50 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a46.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.16.3); Tue, 05 Mar 2019 22:14:50 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Fearful-Invention: 625f04a5101e15ce_1551824090661_2199242855 X-MC-Loop-Signature: 1551824090660:1765637021 X-MC-Ingress-Time: 1551824090660 Received: from pdx1-sub0-mail-a46.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a46.g.dreamhost.com (Postfix) with ESMTP id 171698027E for <34680@debbugs.gnu.org>; Tue, 5 Mar 2019 14:14:50 -0800 (PST) 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=JsfLoJ Ja54UpiDmWKBeYvECCZ+w=; b=TvhHxfaAsNSRXEu5tjxBrNk8SKzy3AXrasWZjR ZfZU2p1a8oDyFOhW+QXAf1X6t3dqxhiGyCuXu2As3F6iIUL1WskWG8o0R0YcZGFr LyyVatAmK1hFKaje4G5yCv26W4zJAznmO7LmDAFZ/r1t14rR4Zf91Xigm1j+bacD dLOo8= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (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-a46.g.dreamhost.com (Postfix) with ESMTPSA id 40E1E80270 for <34680@debbugs.gnu.org>; Tue, 5 Mar 2019 14:14:47 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a46 From: Juri Linkov To: 34680@debbugs.gnu.org Subject: Re: bug#34680: Display monitor frames not warmed up Organization: LINKOV.NET References: <875zt5ueue.fsf@mail.linkov.net> <87y35zfwni.fsf@mail.linkov.net> <871s3mtkrg.fsf@mail.linkov.net> Date: Tue, 05 Mar 2019 23:28:00 +0200 In-Reply-To: <871s3mtkrg.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 04 Mar 2019 23:03:31 +0200") Message-ID: <87r2bl5c37.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrfeefgdduiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepghhnuhdrohhrghenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefgeeikedtseguvggssghughhsrdhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34680 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 (-) >>> I guess calling the function =E2=80=98message=E2=80=99 before calling >>> =E2=80=98display-monitor-attributes-list=E2=80=99 performs some redis= play that adds >>> the frame to the list of frames in =E2=80=98display-monitor-attribute= s-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=98= redraw-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 somehow= =E2=80=9Cregisters=E2=80=9D the >> frame in the list of frames, so the next call of =E2=80=98display-moni= tor-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 with references from http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00131.html http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00474.html Although the original bug report was for macOS, the same bug I see is for GDK on GNU/Linux. At least, I found a fix for GDK that populates the 'frames' attribute. But if on macOS display-monitor-attributes-list returns no 'frames' attribute, this feature is unavailable on macOS. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 17:44:10 2019 Received: (at 34680-done) by debbugs.gnu.org; 19 Mar 2019 21:44:10 +0000 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 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 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) 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 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 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= 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 From: Juri Linkov To: 34680-done@debbugs.gnu.org Subject: Re: bug#34680: Display monitor frames not warmed up Organization: LINKOV.NET References: <875zt5ueue.fsf@mail.linkov.net> <87y35zfwni.fsf@mail.linkov.net> <871s3mtkrg.fsf@mail.linkov.net> <87r2bl5c37.fsf@mail.linkov.net> Date: Tue, 19 Mar 2019 23:43:34 +0200 In-Reply-To: <87r2bl5c37.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 05 Mar 2019 23:28:00 +0200") Message-ID: <87r2b2ee0p.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrieeggdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepghhnuhdrohhrghenucfkphepledurdduvdelrddutdeirddufeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirddufedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefgeeikedtqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34680-done 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 (-) >>>> 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. From unknown Mon Aug 18 04:38:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 17 Apr 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator