From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: 54844@debbugs.gnu.org
Subject: bug#54844: 29.0.50; pgtk: with --daemon, DISPLAY gets set to "wayland-0"
Date: Mon, 11 Apr 2022 09:10:22 +0800 [thread overview]
Message-ID: <878rsc77cx.fsf@yahoo.com> (raw)
In-Reply-To: <87ee2477oe.fsf@yahoo.com> (Po Lu's message of "Mon, 11 Apr 2022 09:03:29 +0800")
Po Lu <luangruo@yahoo.com> writes:
> Yep, this is in the multi-TTY code. I'll fix that.
Does this fix the problem?
diff --git a/src/callproc.c b/src/callproc.c
index 0922e10f01..1e74836682 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -85,6 +85,10 @@ #define _P_NOWAIT 1 /* from process.h */
#include "nsterm.h"
#endif
+#ifdef HAVE_PGTK
+#include "pgtkterm.h"
+#endif
+
/* Pattern used by call-process-region to make temp files. */
static Lisp_Object Vtemp_file_name_pattern;
@@ -1812,6 +1816,18 @@ make_environment_block (Lisp_Object current_dir)
if (NILP (display))
{
Lisp_Object tmp = Fframe_parameter (selected_frame, Qdisplay);
+
+#ifdef HAVE_PGTK
+ /* The only time GDK actually returns correct information is
+ when it's running under X Windows. DISPLAY shouldn't be
+ set to a Wayland display either, since that's an X specific
+ variable. */
+ if (FRAME_WINDOW_P (SELECTED_FRAME ())
+ && strcmp (G_OBJECT_TYPE_NAME (FRAME_X_DISPLAY (SELECTED_FRAME ())),
+ "GdkX11Display"))
+ tmp = Qnil;
+#endif
+
if (!STRINGP (tmp) && CONSP (Vinitial_environment))
/* If still not found, Look for DISPLAY in Vinitial_environment. */
tmp = Fgetenv_internal (build_string ("DISPLAY"),
next prev parent reply other threads:[~2022-04-11 1:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-10 21:50 bug#54844: 29.0.50; pgtk: with --daemon, DISPLAY gets set to "wayland-0" Sean Whitton
2022-04-11 1:03 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-11 1:10 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-04-11 18:46 ` Sean Whitton
2022-04-12 1:22 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 5:21 ` Sean Whitton
2022-04-12 5:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=878rsc77cx.fsf@yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=54844@debbugs.gnu.org \
--cc=luangruo@yahoo.com \
--cc=spwhitton@spwhitton.name \
/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.