GNU bug report logs -
#67628
Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error
Previous Next
Full log
Message #23 received at 67628 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> 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?
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.
This bug report was last modified 1 year and 253 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.