Closed marbetschar closed 3 years ago
Never mind my comment about on_events_updated
, that's out of scope for this.
Seems to work as expected. As I said in my last comment there are a few minor style things, but I think this pretty much works! I'll approve it once we get those sorted.
@mcclurgm thanks for your review! I addressed the proposed changes and I think we should be good to go here now.
Alright, seems good to me.
Latest Calendar version comes with the autostart entry for the daemon (at /etc/xdg/autostart/io.elementary.calendar-daemon.desktop
) though it never really starts the daemon. 😕 Was this intended?
@ghsttwn no, this was not the intention :)
The daemon should be autostarted as soon as you end your session and start a new one (read "logout and login again"). Doesn't this work on your end? If not, can you please open a new issue with a link to this PR, so we can investigate there?
This PR fixes the notification icon issue from #677 by embedding the daemonized background process into the same application binary (in the screenshot: "Other" is before this change, the correct notification is after this change):
This way, we gain the following benefits:
1. The notification icon is correct
The notification icon is read from the
Icon
key stored in/usr/share/applications/{application_id}.desktop
. Since the background process shares the sameapplication_id
as the main application, the notification server uses the correct icon to display the alert.2. The background process starts automatically
Autostart files are read from
/etc/xdg/autostart/{application_id}.desktop
. We can easily place a second desktop file with the EXEC lineio.elementary.calendar --background
in this directory.3. When clicking on the notification, the corresponding app opens
When clicking on the notification, the notification server executes the
Exec
key of the/usr/share/applications/{application_id}.desktop
file. Here it is crucial we embedded the background process within the same binary - because this way, the regular binary starts and the user is presented with the app itself. Just like we want it.4.
System Settings > Notifications
work as expectedAs it turned out when working on this in Mail, if we don't embed the background process within the same binary we either end up with two application entries there - or even worse, with one which does not have any effect at all.