GNU bug report logs - #67628
Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error

Previous Next

Package: emacs;

Reported by: Herman <mahlamytsike <at> gmail.com>

Date: Mon, 4 Dec 2023 20:02:01 UTC

Severity: normal

Full log


Message #20 received at 67628 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: mahlamytsike <at> gmail.com, 67628 <at> debbugs.gnu.org
Subject: Re: 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
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Herman <mahlamytsike <at> gmail.com>,  67628 <at> debbugs.gnu.org
> Date: Tue, 05 Dec 2023 20:37:00 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> 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?




This bug report was last modified 1 year and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.