From: Davide Masserut via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 65509@debbugs.gnu.org
Subject: bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries
Date: Thu, 24 Aug 2023 20:32:47 +0200 [thread overview]
Message-ID: <87ttsomgb5.fsf@mssdvd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
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''
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-correct-env-var-when-opening-frames-with-freedes.patch --]
[-- Type: text/patch, Size: 1740 bytes --]
From c4f516e30c72fbc88838f2ad52730d5e26f8f358 Mon Sep 17 00:00:00 2001
From: Davide Masserut <dm@mssdvd.com>
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
next reply other threads:[~2023-08-24 18:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 18:32 Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-08-31 9:34 ` bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries Eli Zaretskii
2023-08-31 11:32 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-01 18:43 ` Stefan Kangas
2023-09-01 19:04 ` Eli Zaretskii
2023-09-02 16:24 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 16:58 ` Eli Zaretskii
2023-09-03 0:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 5:34 ` Eli Zaretskii
2023-09-03 6:07 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:13 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:41 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:48 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:51 ` Stefan Kangas
2023-09-03 13:00 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 13:31 ` Stefan Kangas
2023-09-03 13:42 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 14:46 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 0:07 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 14:01 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07 8:26 ` Eli Zaretskii
2023-09-07 9:26 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07 9:37 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 15:49 ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 7:05 ` Eli Zaretskii
2023-09-15 7:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 7:32 ` Eli Zaretskii
2023-09-15 7:44 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 11:34 ` Eli Zaretskii
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=87ttsomgb5.fsf@mssdvd.com \
--to=bug-gnu-emacs@gnu.org \
--cc=65509@debbugs.gnu.org \
--cc=dm@mssdvd.com \
/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.