From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54844: 29.0.50; pgtk: with --daemon, DISPLAY gets set to "wayland-0" Date: Mon, 11 Apr 2022 09:10:22 +0800 Message-ID: <878rsc77cx.fsf@yahoo.com> References: <87wnfwa9qz.fsf@melete.silentflame.com> <87ee2477oe.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34327"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 54844@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 11 03:11:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndiaE-0008nY-Qy for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Apr 2022 03:11:10 +0200 Original-Received: from localhost ([::1]:34282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndiaD-0004rg-F8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Apr 2022 21:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndia7-0004rW-3h for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 21:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ndia6-0007I7-Rj for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 21:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ndia6-0000wB-HQ for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 21:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Apr 2022 01:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54844 X-GNU-PR-Package: emacs Original-Received: via spool by 54844-submit@debbugs.gnu.org id=B54844.16496394383573 (code B ref 54844); Mon, 11 Apr 2022 01:11:02 +0000 Original-Received: (at 54844) by debbugs.gnu.org; 11 Apr 2022 01:10:38 +0000 Original-Received: from localhost ([127.0.0.1]:41882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndiZi-0000vY-FQ for submit@debbugs.gnu.org; Sun, 10 Apr 2022 21:10:38 -0400 Original-Received: from sonic307-10.consmr.mail.ne1.yahoo.com ([66.163.190.33]:38283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndiZg-0000vL-49 for 54844@debbugs.gnu.org; Sun, 10 Apr 2022 21:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649639430; bh=cB39wOzEXlCexm+F8uOjad6mAEOZsmU5+grOm0r6X94=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=epNndRT5kCSCqXpFKg/j9v8fWCcPHFt26fLMog18MxG8RZa+bEFPcotVSQin0oFQwIQcTLAIDA2Pi/F0Y4OJMZwkJfOp8F9D62J/Jdc3CNEY6YRrwVVSABTLkju/irsMU78wDIjBTlURiEpITKqkkToyVJigP69RGJ4sUz4U9oGz/c+uBp24YNPPKdujsQuxFW/FmzzaUwLXm/v3CcPu1RygPgOukGp3osumtF18P4w1hLbeQpbp8PX3tu9fGCwQuUrFWxAOU7a88TOJV8EKHWmDWgZ1nXBjcpGok+l0Q5CoXu7pAogUeNtGhcYk4q+ijA9nPIzOkRo2Ds6OG0e/8g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649639430; bh=ns5P2JN2QG5GL7J3VlCf1Lcwgs1j9cBKTtk25nFOFte=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qii8aqhspBsGK4sROtMus+lASApi/NQZxrQ8OJcyHqBglibn9tPuzdL471tBVOvRQj31NNDvT7Wr9TlA99UVxBO2XylduiBEsO5bIm6AbJYhnuRp14KEp8hPnB6vtJn/tiPMHAnz19nxufbLStxKnlqrlC12iwebKPW4fnPMldZ6sZ5kOEMLFVNJ7coY/WYVMlOwWx03uO5bkPlgvYoP4LQFtx0gm5IykWXAn0IMglOZjrbVEHm83HwTGM77eiJPo6t65fhlA2fXY72pl16ZUPVqIBtl2vEY/+sxFiMq3p66hqE4lvB24ocmHRDU8TZDyEPKQ0nzCdfvyvudWXLQGQ== X-YMail-OSG: SpWjtIYVM1nlbJ3a6pQEcMxcdHMMXmZ9aH.YyVm.UDySfSHtdYlQZIG8c4TD7dl Uy1ERlAc6MBslgsVhzkesCAruYJa.V17Fqj6d4YrtQP.3FQAxKtctTHr5XqUKAU7FYg1BmroiUa2 CWETW5nLTMDh_Nd2ow7k3ZkZjqRjSCXyFDbjlN0A__7O2PyX3Q69NZPbyl5i_eZE0.Gl.gOWgOi4 P9tf2tMqLdl..atmPyhY6bTmDfD1En8c0Xk1VDUb.I4ipt99XotVxMd6haIz.HJDunS5UFXfD9LH 09xviIWaERMbVThtSbmXkt5SLJclP3zTD8S7gNTFEf3Dc9cby89NYL9YEu7OPv2biJRsjd1wNTNj 4mfd91P607fpQgkAku7GoTxl2SXUY4G6Y1srQPNHjBHQBQVnLY9jinm8TXYybYMpPsUtgJ5TZWZz gNF_3Ly3KLQcUZNqvuXWE8M.ZxVkcPCBqTJPhKjPyuMcLCS3XL4NFqTroqSKb0ADBsVnSwt2xybD DqC6stY.re4uMFdTQmH7Yc1OvvLgmQfTM1FZnRxCI19imJ3cbNqS0pC204oKu1bzFsWJpqgdm7Jm 3dtXTQBZHKRZhNT7W96JDaZWUPXCnPAhbpttDDn2DB0xY.b7rMX_RduHykVtUd48lc0kJy.bCnGZ 903cPyyUrdSjuJLRc9vTxYPJslTWOIubbZGwneZRG9zxZhmLcig28rvlF1V02tOmDkyxBFr3TTRC YNn2OtjOhMk4MdQclU4Ga7bUjZOuL7_GboK.OfG8POaDs0n6DPvhl.18H.ZBwe5u1A6Cx1pJtg_C JouVD4V7KLEKObqr7WeeD8Aul8sjF7_fNqSovZSCQL X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Mon, 11 Apr 2022 01:10:30 +0000 Original-Received: by hermes--canary-production-sg3-65d7bd97b5-c48mf (VZM Hermes SMTP Server) with ESMTPA ID 5af393c174d68390386e729d027933dc; Mon, 11 Apr 2022 01:10:26 +0000 (UTC) In-Reply-To: <87ee2477oe.fsf@yahoo.com> (Po Lu's message of "Mon, 11 Apr 2022 09:03:29 +0800") X-Mailer: WebService/1.1.20048 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229691 Archived-At: Po Lu 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"),