From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mahlamytsike@gmail.com, 67628@debbugs.gnu.org
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 [thread overview]
Message-ID: <875y1bo71r.fsf@yahoo.com> (raw)
In-Reply-To: <83sf4f4kcq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Dec 2023 13:54:29 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Po Lu <luangruo@yahoo.com>
>> Cc: Herman <mahlamytsike@gmail.com>, 67628@debbugs.gnu.org
>> Date: Tue, 05 Dec 2023 20:37:00 +0800
>>
>> Eli Zaretskii <eliz@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.
next prev parent reply other threads:[~2023-12-06 12:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 17:31 bug#67628: Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error Herman
2023-12-04 20:11 ` Eli Zaretskii
2023-12-04 22:44 ` Herman
2023-12-05 12:30 ` Eli Zaretskii
2023-12-05 12:37 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 11:54 ` Eli Zaretskii
2023-12-06 12:21 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-06 12:38 ` Eli Zaretskii
2023-12-06 12:40 ` Eli Zaretskii
2023-12-06 12:50 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 13:15 ` Eli Zaretskii
2023-12-07 1:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09 9:12 ` Eli Zaretskii
2023-12-06 12:41 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 13:10 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875y1bo71r.fsf@yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=67628@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
--cc=mahlamytsike@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.