Subject: bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries

From: Po Lu <[email-masked]>
Date: Wed, 06 Sep 2023 08:07:22 +0800

Davide Masserut <[email-masked]> writes:

> Correct.  However, that TTY is occupied by the X window manager, which
> hides the Emacs interface.
>
> When the argument of --display doesn't exits or is empty, should we
> check if $DISPLAY is present in the environment and use its value?
>
> When PGTK is enabled, we could check $WAYLAND_DISPLAY and then
> $DISPLAY before resorting to displaying the frame in a terminal or in
> a TTY.
>
> I tested this with Gnome and i3, both started from a TTY using
> startx. I'm not sure how this behaves when using a display manager.

Display selection is GTK's territory, and we basically give it carte
blanche to judge which displays are suitable, since we can't account for
every present and future GDK backend.

Only subsequent to the establishment of the display connection are we
capable of taking display-specific action, such as displaying a warning
message.