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 13:54:29 +0200 Message-ID: <83sf4f4kcq.fsf@gnu.org> References: <20231204193138.3bb398b8@Elitebook> <83il5d683k.fsf@gnu.org> <20231205004405.3fc7190e@Elitebook> <83a5qo6dce.fsf@gnu.org> <87edg0omfn.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1756"; 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 12:55:06 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 1rAqUc-000092-6g for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Dec 2023 12:55:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAqUO-0003KQ-L0; Wed, 06 Dec 2023 06:54: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 1rAqUM-0003KG-SC for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 06:54:51 -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 1rAqUM-0007qG-I4 for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 06:54:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAqUY-0006G7-2A for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 06:55: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 11:55: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.170186368324029 (code B ref 67628); Wed, 06 Dec 2023 11:55:02 +0000 Original-Received: (at 67628) by debbugs.gnu.org; 6 Dec 2023 11:54:43 +0000 Original-Received: from localhost ([127.0.0.1]:38967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAqUF-0006FV-EW for submit@debbugs.gnu.org; Wed, 06 Dec 2023 06:54:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAqUE-0006FG-5Z for 67628@debbugs.gnu.org; Wed, 06 Dec 2023 06:54:42 -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 1rAqTw-0007nz-LK; Wed, 06 Dec 2023 06:54:24 -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=QtjO3xvCQS35LhFWUsvjE8/mKEK2DLQ4mscZ4MuamYY=; b=UHJFtKzwCxY2 erI00mih764bovMHAXaEJHb3xpsXMWtZ0iKVN7Ii3f6KlaFLaIsh+bZy6M5W0ptEByOwPElDDIO2R UiLusahNKAZPxNbLNxzVyCU5g8uaD2g73iyCW6Cq49C0wGF97upsszeAjIS0uIB6oCjvm7eBfccmg R47aFGjRqKn/MSviOIZypK1ZEWilpMDFRaXZsySHCVYWqKiwr6CU9cKzRxsRYicFew7Ugps0rcPk7 AC97FsDW90PM5+/yqycPEalUtqIO3fN5T6mdXg7J11tAjA4VQ7UtimNFqAup5D0RJL6P21gXnRTVw xr9T8zt8+4Lzh4JtZNcVKQ==; In-Reply-To: <87edg0omfn.fsf@yahoo.com> (message from Po Lu on Tue, 05 Dec 2023 20:37:00 +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:275587 Archived-At: > 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? > 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?