unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries
@ 2023-08-24 18:32 Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  9:34 ` Eli Zaretskii
  0 siblings, 1 reply; 30+ messages in thread
From: Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-24 18:32 UTC (permalink / raw)
  To: 65509

[-- 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


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-09-15 11:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 18:32 bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31  9:34 ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).