From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 20:21:36 +0800 Message-ID: <875y1bo71r.fsf@yahoo.com> References: <20231204193138.3bb398b8@Elitebook> <83il5d683k.fsf@gnu.org> <20231205004405.3fc7190e@Elitebook> <83a5qo6dce.fsf@gnu.org> <87edg0omfn.fsf@yahoo.com> <83sf4f4kcq.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: mahlamytsike@gmail.com, 67628@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 06 13:22:58 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 1rAqvZ-0008Uv-Kw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Dec 2023 13:22:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAqvU-0000Fx-HN; Wed, 06 Dec 2023 07:22:52 -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 1rAqvS-0000FX-TA for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:22:50 -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 1rAqvS-00045m-Kk for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:22:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAqve-0006wH-A4 for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 07:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Dec 2023 12:23: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.170186532826602 (code B ref 67628); Wed, 06 Dec 2023 12:23:02 +0000 Original-Received: (at 67628) by debbugs.gnu.org; 6 Dec 2023 12:22:08 +0000 Original-Received: from localhost ([127.0.0.1]:39003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAqum-0006v0-2x for submit@debbugs.gnu.org; Wed, 06 Dec 2023 07:22:08 -0500 Original-Received: from sonic311-23.consmr.mail.ne1.yahoo.com ([66.163.188.204]:41072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAquj-0006u0-LU for 67628@debbugs.gnu.org; Wed, 06 Dec 2023 07:22:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701865308; bh=5UdRx6L43CGj7uRjj8mI6eCZk0nRnPKpatmBHBToRsw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=mN42sg3WTJnMwcrhUesgQdwwyybByL//tDf70m1gb7O+suaVbnaqoAUdgpSYRZoCWnT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zpwGtqHgeeDKMIop4UHfkdDb.Ikm7zg1gF4KHa6OHrecfwExYpXEWt7YQ2K0E.o8x50puiRbY cYuwi_5Zqc9zUursSevDz3P14N930YUDBaLyEc9I.4oyCX0Sx5FaiBdzQ2eF2_14DhpFj9SzTAuE KplSbvz1aSvpwm0mVi8RUDWoFDBPnZfdz6n9Wg4vtHSUvSbgaEShgyeZW67Yx8FC6jyoI36XsPU7 j2JNk5XONQWanyXN20WYNDrI692gs.XlnlIviKMo8bS3II2ArkN5cpmDojr9isRJxFM1lidHw.QO MJ_FM4o8DXa.gIO8jD.bistPlEWOH_lcOOuFlVFARrr3fqOxc8NSMb_jNhbm2jGlo0tquc68MjD8 3rg2USzWrGgzBa6bXZF7gJgVtrp.YRR70M2NCCHJQQQgoVMWAuz7tfLKYoxw5EEuwQIhW9cL8LDu G778j97Ghc.I.P5joyc_ABrEdw6BCHBj65Z579Mj3OfFZecNEq.oUch59MvWoXWE.ilHTb0wcAJB TFHZHmrdgRqq8ULTCzcCOf7BV6O7wLmVvcfi.bQooS X-Sonic-MF: X-Sonic-ID: 9c8dfaf3-0cd3-4e12-9546-20ac618c68ba Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Wed, 6 Dec 2023 12:21:48 +0000 Original-Received: by hermes--production-sg3-f6b777bf6-762ld (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0479a84eb7d4d86d3420e0d065bf5f8c; Wed, 06 Dec 2023 12:21:44 +0000 (UTC) In-Reply-To: <83sf4f4kcq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Dec 2023 13:54:29 +0200") X-Mailer: WebService/1.1.21943 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:275591 Archived-At: Eli Zaretskii writes: >> From: Po Lu >> Cc: Herman , 67628@debbugs.gnu.org >> Date: Tue, 05 Dec 2023 20:37:00 +0800 >> >> Eli Zaretskii writes: >> >> >> If in 29.1 now >> >> $ emacs --daemon -Q >> >> $ emacsclient -e "(setq debug-on-error t)" >> >> then >> >> $ emacsclient -e "(make-frame-on-display (getenv \"DISPLAY\"))" >> >> does not give an error, i.e. the display is found >> >> >> >> but if >> >> $ emacs --daemon -Q >> >> $ emacsclient -e "(setq debug-on-error t)" >> >> then >> >> $ emacsclient -e "(x-open-connection (getenv \"DISPLAY\"))" >> >> gives an error, i.e. the display does not exist. >> > >> > Po Lu, any ideas or suggestions? >> >> 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. Thanks.