]> git.eshelyaron.com Git - emacs.git/commitdiff
Advertise support for Startup Notification when built with GTK
authorPeter Oliver <git@mavit.org.uk>
Tue, 22 Jun 2021 13:17:28 +0000 (15:17 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 22 Jun 2021 13:17:28 +0000 (15:17 +0200)
* etc/emacsclient.desktop, etc/emacsclient.desktop: Specify
StartupNotify=true.
* configure.ac (USE_STARTUP_NOTIFICATION): New variable, yes iff
HAVE_GTK.
* Makefile.in (install-etc): Remove StartupNotify=true from
etc/*.desktop unless USE_STARTUP_NOTIFICATION (bug#48783).

Makefile.in
configure.ac
etc/NEWS
etc/emacs.desktop
etc/emacsclient.desktop

index 474441fa93c3ea8ed7a2f9ac4e110ba48fc2e952..b7502880230a85a5767dc30b59e12d995353bf45 100644 (file)
@@ -100,6 +100,8 @@ FIND_DELETE = @FIND_DELETE@
 
 HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
 
+USE_STARTUP_NOTIFICATION = @USE_STARTUP_NOTIFICATION@
+
 # ==================== Where To Install Things ====================
 
 # Location to install Emacs.app under GNUstep / macOS.
@@ -706,11 +708,15 @@ install-man:
 ## Note: emacs22 does not have all the resolutions.
 EMACS_ICON=emacs
 
+ifeq (${USE_STARTUP_NOTIFICATION},no)
+USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d"
+endif
 install-etc:
        umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
        tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
        sed -e "/^Exec=emacs/ s/emacs/${EMACS_NAME}/" \
          -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
+         $(USE_STARTUP_NOTIFICATION_SED_CMD) \
          ${srcdir}/etc/emacs.desktop > $${tmp}; \
        ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"; \
        rm -f $${tmp}
@@ -718,6 +724,7 @@ install-etc:
        client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
        sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
          -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
+         $(USE_STARTUP_NOTIFICATION_SED_CMD) \
          ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
        ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
        rm -f $${tmp}
index c828f8d78282e7af18a40d00f8e9e973c41edbc3..830f33844b6be483a0d0950c466111fc3d53c207 100644 (file)
@@ -2892,6 +2892,11 @@ fi
 AC_SUBST(SETTINGS_CFLAGS)
 AC_SUBST(SETTINGS_LIBS)
 
+USE_STARTUP_NOTIFICATION=no
+if test "${HAVE_GTK}" = "yes"; then
+    USE_STARTUP_NOTIFICATION=yes
+fi
+AC_SUBST(USE_STARTUP_NOTIFICATION)
 
 dnl SELinux is available for GNU/Linux only.
 HAVE_LIBSELINUX=no
index 3c7d5ca10becf1172698ff71a673a73c4ed75f86..40c7c931624b89af510e75bc8a8711f511383739 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -91,6 +91,12 @@ proper pty support that Emacs needs.
 \f
 * Startup Changes in Emacs 28.1
 
+---
+** In GTK builds, Emacs now supports startup notification.
+This means that Emacs won't steal keyboard focus upon startup
+(when started via the Desktop) if the user is typing into another
+application.
+
 ** Emacs can support 24-bit color TTY without terminfo database.
 If your text-mode terminal supports 24-bit true color, but your system
 lacks the terminfo database, you can instruct Emacs to support 24-bit
index 2e6496e58c9991e38edba386c230e32071f503af..81c53c6121d83d44f6ca8e465e3280783ac244d7 100644 (file)
@@ -8,5 +8,6 @@ Icon=emacs
 Type=Application
 Terminal=false
 Categories=Development;TextEditor;
+StartupNotify=true
 StartupWMClass=Emacs
 Keywords=Text;Editor;
index 3feb83c7290a4b37cbfcd8e5e9abc0cd177fc514..2c1edb4b66a2669ca78c1e05793becb91d5a0a30 100644 (file)
@@ -8,5 +8,6 @@ Icon=emacs
 Type=Application
 Terminal=false
 Categories=Development;TextEditor;
+StartupNotify=true
 StartupWMClass=Emacsd
 Keywords=Text;Editor;