Subject: bug#63555: emacs 29 complains that it can't connect to the display

From: Po Lu <[email-masked]>
Date: Sat, 17 Aug 2024 16:22:05 +0800

Eli Zaretskii <[email-masked]> writes:

> Ping! Ping! Po Lu, could you please respond?
>
>> Cc: [email-masked], [email-masked]
>> Date: Sun, 04 Aug 2024 10:50:53 +0300
>> From: Eli Zaretskii <[email-masked]>
>> 
>> Ping!  Po Lu, any comments?
>> 
>> > Cc: [email-masked]
>> > Date: Sat, 20 Jul 2024 12:00:35 +0300
>> > From: Eli Zaretskii <[email-masked]>
>> > 
>> > > Date: Sun, 14 Jul 2024 22:00:26 +0100 (BST)
>> > > From: Peter Oliver <[email-masked]>
>> > > 
>> > > FWIW, here is a patch which causes Emacs to check that at least one of the environment variables WAYLAND_DISPLAY, DISPLAY, BROADWAY_DISPLAY is set before it will try to use PGTK for its initial window.
>> > > 
>> > > This patch is not suitable for merging, because it doesn’t consider what happens if you try to use PGTK on Windows or MacOS.  However, people might find it useful if they’re not using one of those platforms.
>> > > 
>> > > This patch depends on the patch for bug 72118.
>> > 
>> > Po Lu, any comments?
>> > 
>> > 
>> > 
>> > 
>> 
>> 
>> 
>> 

This is fundamentally an improper approach because there's no predicting
what variables GTK will use in the future.  Moreover, it will prevent
Emacs from starting in some Wayland sessions where WAYLAND_DISPLAY is
sometimes not set, and where the libwayland client/GTK simply tries
`wayland-0' or aborts if it's unavailable.