Skip to content

Commit

Permalink
Auto-start m-n-d with session
Browse files Browse the repository at this point in the history
Relying on D-Bus activation to launch org.freedesktop.Notifications can
result in selecting the wrong implementation if multiple daemons are
installed.

Fix this by launching m-n-d with the session rather than depending on
D-Bus activation.  We keep D-Bus activation for the moment for backward
compatibility and to re-start the daemon in otherwise non-problematic
situations if it crashes.

Fixes #133 and #174.
  • Loading branch information
raveit65 authored and cwendling committed Aug 9, 2023
1 parent 56a1f65 commit fc6a01d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ AM_CONDITIONAL([ICON_UPDATE], [test -n "$UPDATE_ICON_CACHE"])
AC_CONFIG_FILES([
Makefile
data/Makefile
data/mate-notification-daemon.desktop.in
data/org.freedesktop.mate.Notifications.service
data/org.mate.applets.MateNotificationApplet.desktop.in
data/org.mate.NotificationDaemon.gschema.xml
Expand Down
13 changes: 13 additions & 0 deletions data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ servicedir = $(DBUS_SERVICES_DIR)
service_DATA = org.freedesktop.mate.Notifications.service org.mate.panel.applet.MateNotificationAppletFactory.service
service_in_files = $(service_DATA:=.in)

autostartdir = $(sysconfdir)/xdg/autostart
autostart_in_files = mate-notification-daemon.desktop.in
autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)

$(autostart_DATA): $(autostart_in_files)
if USE_NLS
$(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
else
$(AM_V_GEN) sed '/^# Translators/d' < $< > $@
endif

appletdir = $(datadir)/mate-panel/applets
applet_DATA = org.mate.applets.MateNotificationApplet.mate-panel-applet
applet_in_files = $(applet_DATA:.mate-panel-applet=.desktop.in)
Expand Down Expand Up @@ -43,6 +54,7 @@ gsettingsschema_in_files = $(gsettings_SCHEMAS:=.in)
@GSETTINGS_RULES@

EXTRA_DIST = \
$(autostart_in_files) \
$(desktop_in_files) \
$(gsettingsschema_in_files) \
$(icon16_DATA) \
Expand All @@ -53,6 +65,7 @@ EXTRA_DIST = \
$(iconscalable_DATA)

CLEANFILES = \
$(autostart_DATA) \
$(applet_DATA) \
$(desktop_DATA) \
$(gsettings_SCHEMAS)
Expand Down
14 changes: 14 additions & 0 deletions data/mate-notification-daemon.desktop.in.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=MATE Notification Daemon
Comment=Display notifications
Exec=@LIBEXECDIR@/mate-notification-daemon
Terminal=false
Type=Application
OnlyShowIn=MATE;
NoDisplay=true
X-MATE-Autostart-Phase=Application
X-MATE-Autostart-Notify=true
X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=mate-notification-daemon
X-MATE-Bugzilla-Component=general
X-MATE-Bugzilla-Version=@VERSION@

0 comments on commit fc6a01d

Please sign in to comment.