From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67628: Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error Date: Wed, 06 Dec 2023 14:38:25 +0200 Message-ID: <83fs0f4ibi.fsf@gnu.org> References: <20231204193138.3bb398b8@Elitebook> <83il5d683k.fsf@gnu.org> <20231205004405.3fc7190e@Elitebook> <83a5qo6dce.fsf@gnu.org> <87edg0omfn.fsf@yahoo.com> <83sf4f4kcq.fsf@gnu.org> <875y1bo71r.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5577"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mahlamytsike@gmail.com, 67628@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 06 13:39:07 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 1rArBC-0001Ce-7z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Dec 2023 13:39:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rArB3-0003LJ-JH; Wed, 06 Dec 2023 07:38:58 -0500 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 1rArAx-0003Je-LU for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:38:53 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rArAw-0006jr-Lp for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:38:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rArB8-0001Vi-BV for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Dec 2023 12:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67628 X-GNU-PR-Package: emacs Original-Received: via spool by 67628-submit@debbugs.gnu.org id=B67628.17018663275777 (code B ref 67628); Wed, 06 Dec 2023 12:39:02 +0000 Original-Received: (at 67628) by debbugs.gnu.org; 6 Dec 2023 12:38:47 +0000 Original-Received: from localhost ([127.0.0.1]:39029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rArAt-0001V7-C2 for submit@debbugs.gnu.org; Wed, 06 Dec 2023 07:38:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rArAr-0001Uv-Eh for 67628@debbugs.gnu.org; Wed, 06 Dec 2023 07:38:46 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rArAa-0006h2-7q; Wed, 06 Dec 2023 07:38:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=stxfDXLFJ5WN6Fa9jqkkiC/lVB8JXwv11V264vPdRlk=; b=dnNNOLgLCcf9 ScrjRYLOs2eAj3YaWHRpOlviEWjTdJHUXTZGKXRYjzay7LNA05YJ4APzMYTAbFJCSs/JPNHjAAaPR 3TN93OTCKbJJr/lRDmBsOWF1NuCMYZWZppDidXL+BVVltKEIY5zY8PHvziN0sf93KxVA3imYtFA/L 6tkjSr7DHxmPXrAx5BLIZJnrFRp0TwP0nZKgJ3tg5PLqiwb4OskqLNaX7z5jEzSrZKBrmzJTvbAL1 oImmLNv5AbJS/zbgAZZh+SmnyttACvhWLDTK2mUXHTVuIdS3X0JZDSpFHbC/Ls0BqqiFSdsorvsKx lX6xWN85pChkru9GXHOvXQ==; In-Reply-To: <875y1bo71r.fsf@yahoo.com> (message from Po Lu on Wed, 06 Dec 2023 20:21:36 +0800) 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:275594 Archived-At: > From: Po Lu > Cc: mahlamytsike@gmail.com, 67628@debbugs.gnu.org > Date: Wed, 06 Dec 2023 20:21:36 +0800 > > Eli Zaretskii writes: > > >> The display is opened successfully, but the next event to arrive > >> activates the dynamic-setting machinery that calls get-device-terminal, > >> which signals an error in response to there being no frames on that > >> display at the time. > > > > So you are saying that this is an issue with the fine timing of when > > the event arrives? And if it arrived a bit later, it would have been > > processed correctly? > > No, see below. > > >> The sound fix is for get-device-terminal to search for the device > >> provided within x_display_list instead of the list of live frames. > > > > I'm not sure this is the correct fix. If a frame is not yet in the > > list of live frames exposed to Lisp, it might mean the frame is not > > yet fully set up, and some code running off the dynamic-setting > > machinery could similarly fail, right? > > > > Wouldn't it be better to delay the processing of this event until the > > frame is fully set? > > There's no frame being created halfway in this scenario. Rather, a > display connection is opened _without_ creating any frames, from which a > dynamic-setting event subsequently arrives. If the frame doesn't exist, why do we consider this anything but a cockpit error? Or why would the dynamic-setting machinery call get-device-terminal for a display that has no frames? I guess I'm still missing something, so please elaborate, and maybe point me to the relevant code involved in this. Thanks.