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#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries Date: Wed, 06 Sep 2023 08:07:22 +0800 Message-ID: References: <87ttsomgb5.fsf@mssdvd.com> <83msy7eesk.fsf@gnu.org> <87pm33sazt.fsf@yahoo.com> <835y4tbtpj.fsf@gnu.org> <87pm303499.fsf@mssdvd.com> <8334zwa4vi.fsf@gnu.org> <87y1hokr6v.fsf@yahoo.com> <83jzt795wi.fsf@gnu.org> <87r0nflrhb.fsf@yahoo.com> <87lednqw1v.fsf@mssdvd.com> <871qffl97z.fsf@yahoo.com> <87wmx7jts3.fsf@yahoo.com> <87lednz6u8.fsf@mssdvd.com> <87edjekc1k.fsf@yahoo.com> <87il8oodrm.fsf@mssdvd.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="28858"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Stefan Kangas , 65509@debbugs.gnu.org To: Davide Masserut Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 06 02:08:17 2023 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 1qdg5h-0007I3-G6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Sep 2023 02:08:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdg5U-0006CA-R1; Tue, 05 Sep 2023 20:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdg5R-0006Ba-UL for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 20:08:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdg5R-0007t1-It for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 20:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdg5S-0000G4-9F for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 20:08: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: Wed, 06 Sep 2023 00:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65509 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65509-submit@debbugs.gnu.org id=B65509.1693958869967 (code B ref 65509); Wed, 06 Sep 2023 00:08:02 +0000 Original-Received: (at 65509) by debbugs.gnu.org; 6 Sep 2023 00:07:49 +0000 Original-Received: from localhost ([127.0.0.1]:60013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdg5F-0000FX-5T for submit@debbugs.gnu.org; Tue, 05 Sep 2023 20:07:49 -0400 Original-Received: from sonic313-9.consmr.mail.ne1.yahoo.com ([66.163.185.32]:44824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdg5B-0000F3-Ev for 65509@debbugs.gnu.org; Tue, 05 Sep 2023 20:07:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1693958859; bh=K8R1YeX2YMrrzV6DwkaFGKf1qnEPIqNzjQdyUn9xItg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=OfmTFB/JplvPVqv8eR/Om4Ga50LZmFze3xgxlx+Mq2XiZ5t2f1pcWEoHxxAuvPkbf47bCyN5+V4AEv6oWwFZFehfLBBxkKD/MvePEMkgtfR9Fo5XpZrBcaMPZLeB5DarB8yLu4efPHrb9T2Ky+eTR5k9oECYVUjOlFEgERQwANqaacdGJfEbp0zy5BskevQDewTsYp+lRYlXrCjJr6ZWU8c8L8X6tDjlXpzq7wYogxRCNubv9e9YvJ+fwydsqtd0SHdpCYzGpF2MdglH4c4ayY/K7gA+YBw8HE9ggnNrSW8p6dgHmpS7jTTBOmm0nolTISvgrdaZzKDTwDJyyPUkcw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1693958859; bh=ptsi4HCOMvXvi07B6SUuX4VBePJmsoNTvNFy8utdoOx=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=H5prO45AZ/woiR95p7o/NCuytZu0qfV5E2IrA2PN2G+fAzXjC1fR+YJtSlwf3l1v5QGmH5+fRDzNJyz5c8JZ4nu7doFIUUDDp8hbPPhh1LaNAlacFznmMgdXeRjh7bj7xS/oyRkbiV+nJAnQA3EKzmoRhYJlus2GYWW5gIjM6rXlhTahjMr8tFj9miITLFBd+drQ5SjRa/NYyK8HH39+oIXDiY59q2fXH+DFbDvjOU2nH/o298QIyCEJrL62vpfOkEUn+oHngJL47qwzqvjwFioWI2ZwJZtDs+KIyjEsK/bgmCyP+JWJbhB38YMn4p2vWu6NIIbJxh0ikfrM2YKB9g== X-YMail-OSG: 5GWYumEVM1lHMQ488Rdn0lOPP1DPsNRLRRUGQ0.TnN99scKg1D3Lzzv.ijkP9Iv aThUPIJb5iy2gKDmpafCminbL3tle5ltBt62dbxX7Wq.diN_EgWBHy0OiID.jVKGeNnLH3XsqaHa E1Amd38v8hXKLTmGDWcaN56OhdBCWI4Ld9VV7Xqn32BzUiYXn1XfRq67Bggtc2surrlszFBzdFSd bGxzldiPmjiWqpU8oMsbNALlOF4IIl_bNCITJA8aFDD4UXo4KoKG8E2RZzBsayIQjX6CGn7.Sq2T 9hP6bIeNt5rss4ZZfrbkMdMC78zCQwB_Ar5NGIWSSnoErwhUACN_JmdPhMyw7_GPN46zA2LbkO5d dKxYrgl_6b6jcVqOZskk7BNMD_5hod479vxwO99TALBHIfbhAZmvLJWHDovPG5ktYjHsxZmT7aeO Kzcl5IzyxkU1G3_uWEqY2KQJOrH3D7k6IO.v2s.7cy4CIvTjpymipNK2fC3Ld6KVDumQj19Mbpdh PfMcrJSqkVov8dnFbWjB35enOLX4OLrOrsaYT1WJp1..5nC5eDeDMNIoX9csswW7pbx5ckZF882B NyxaRqMHb_F34W6RFwSH7pzmq8s_GQ4PsLuQSjIXxOY6pOUrQrkGV2_iEjCxeJnli_qMajybK3QC N95jQ9y74EBw_8BKLRKB5CFMPEBQ.nOtqR0jxZbkJDqHzd9RISQ5xyFMrxx2lexKR1Bbtp2kdUWK z67GiAQTZMMwaZGwvJF7ozD4H06zKxxi3aMzC7w4wz014W6Jbw0KKUhxntFmxmAX7Wb1piaKUmNO 5DsRv2LNl5l0HJ7K9ZpOJm76rTqjt5e.CI0FzvrdU7 X-Sonic-MF: X-Sonic-ID: 4d26de60-84e2-4498-a901-1eb070a916e6 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Wed, 6 Sep 2023 00:07:39 +0000 Original-Received: by hermes--production-sg3-69654d8bd-j2jc2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7f0f4dfd3b526da31bba191f5d7aab55; Wed, 06 Sep 2023 00:07:34 +0000 (UTC) In-Reply-To: <87il8oodrm.fsf@mssdvd.com> (Davide Masserut's message of "Tue, 05 Sep 2023 16:46:30 +0200") X-Mailer: WebService/1.1.21763 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269458 Archived-At: Davide Masserut 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.