bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54844: 29.0.50; pgtk: with --daemon, DISPLAY gets set to "wayland-0"


From: Po Lu
Subject: bug#54844: 29.0.50; pgtk: with --daemon, DISPLAY gets set to "wayland-0"
Date: Mon, 11 Apr 2022 09:10:22 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

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"),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]