From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Davide Masserut 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: Thu, 24 Aug 2023 20:32:47 +0200 Message-ID: <87ttsomgb5.fsf@mssdvd.com> Reply-To: Davide Masserut Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35558"; mail-complaints-to="usenet@ciao.gmane.io" To: 65509@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 20:45:36 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 1qZFKp-00093q-LX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 20:45:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZFKF-00042M-Mb; Thu, 24 Aug 2023 14:44:59 -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 1qZFKE-00042E-Dl for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 14:44:58 -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 1qZFKE-0000ml-66 for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 14:44:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZFKI-0006Ys-2R for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 14:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Davide Masserut Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 18:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65509 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169290266725141 (code B ref -1); Thu, 24 Aug 2023 18:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Aug 2023 18:44:27 +0000 Original-Received: from localhost ([127.0.0.1]:38630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZFJj-0006XR-4T for submit@debbugs.gnu.org; Thu, 24 Aug 2023 14:44:27 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:49474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZFJh-0006XE-GU for submit@debbugs.gnu.org; Thu, 24 Aug 2023 14:44:25 -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 1qZFJX-0003zY-J0 for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 14:44:15 -0400 Original-Received: from out-39.mta1.migadu.com ([2001:41d0:203:375::27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZFJU-0000Yp-6e for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 14:44:15 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mssdvd.com; s=key1; t=1692902645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=kpJVrMIbc7Jk2oamzfoLuQMr0N6fEn+C37Kka0gV8M8=; b=KySKbiVh8GgNmJuJXzZ8P23MLKhFTVjUysfZLj9o/FzMIKbpEiSOH+XXT0388T+wNV9By7 idNHaPrg0s8GKyiNJVZQavbCD/KJqdoDsr7oFpvz/xvPhKdM2VW8S6hT9ljVeSt6QKY/c1 zxoo3jVhe4m5sMxsS23yoonAoUafZ7LFKwyNMzPX1DkLepRo1PpLq10phcuwwOhSpK2r7b uJ5k9tHux1OIw9LPdKcYF2b4StpWx2Nzf1vwac6Z2DtN1t6wjN9oSIAQQLvgaQaKeTJ5VU MhmnZxsuBoeXLWEmn8v37gLV+esBVZNctq7JfIpNfNiDf3Vf2bjAoZXwIswNzg== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::27; envelope-from=dm@mssdvd.com; helo=out-39.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:268351 Archived-At: --=-=-= Content-Type: text/plain; format=flowed Tags: patch When Emacs is built with PGTK, frames opened with the emacsclient.desktop entry are opened as X11 windows instead of Wayland. This patch adds a sed command to the Makefile that replaces the environment variable "$DISPLAY" with "$WAYLAND_DISPLAY" when built with PGTK. In GNU Emacs 30.0.50 (build 32, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-08-24 built on T480s Repository revision: 3907c884f03cf5f2a09696bda015b1060c7111ba Repository branch: master System Description: Arch Linux Configured using: 'configure -C --prefix /home/davide/.local --with-pgtk --with-native-compilation --enable-link-time-optimization --enable-locallisppath=/usr/share/emacs/site-lisp/ 'CFLAGS=-march=native -O2'' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Use-correct-env-var-when-opening-frames-with-freedes.patch >From c4f516e30c72fbc88838f2ad52730d5e26f8f358 Mon Sep 17 00:00:00 2001 From: Davide Masserut Date: Thu, 24 Aug 2023 18:33:39 +0200 Subject: [PATCH] Use correct env var when opening frames with freedesktop menu entries Avoid opening X11 frames with emacsclient.desktop or emacsclient-mail.desktop when built with PGTK. * Makefile.in (install-etc): Replace DISPLAY with WAYLAND_DISPLAY when built with PGTK. --- Makefile.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.in b/Makefile.in index fdd9353e254..6a08e1a7b18 100644 --- a/Makefile.in +++ b/Makefile.in @@ -843,6 +843,9 @@ EMACS_ICON= ifeq (${USE_STARTUP_NOTIFICATION},no) USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d" endif +ifeq ($(HAVE_PGTK),yes) +USE_WAYLAND_DISPLAY_SED_CMD=-e "/--display=/ s/DISPLAY/WAYLAND_DISPLAY/" +endif install-etc: umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}" tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ @@ -857,6 +860,7 @@ install-etc: sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \ -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \ $(USE_STARTUP_NOTIFICATION_SED_CMD) \ + $(USE_WAYLAND_DISPLAY_SED_CMD) \ ${srcdir}/etc/emacsclient.desktop > $${tmp}; \ ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \ rm -f $${tmp} @@ -870,6 +874,7 @@ install-etc: client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \ sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \ -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \ + $(USE_WAYLAND_DISPLAY_SED_CMD) \ ${srcdir}/etc/emacsclient-mail.desktop > $${tmp}; \ ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}-mail.desktop"; \ rm -f $${tmp} -- 2.42.0 --=-=-=--