elementary / calendar

Desktop calendar app designed for elementary OS
https://elementary.io
GNU General Public License v3.0
130 stars 39 forks source link

Flatpak: Create Autostart File Via Background Portal #681

Closed Marukesu closed 1 year ago

Marukesu commented 3 years ago

with this calendar will call the background portal to create the daemon autostart on the first launch when sandboxed.

danirabbit commented 3 years ago

Is this a fix for #676 ?

Marukesu commented 3 years ago

Sadly no, this only allow us to create the autostart file when installed as flatpak. since the one that comes with the build is useless on flatpak.

Since gala don't implement the org.gnome.Shell.Introspection interface, the background portal do nothing at all.

marbetschar commented 3 years ago

@Marukesu FYI I added a PR which unifies the daemon and regular app into the same binary. So we may have to rework this a little once this is merged: https://github.com/elementary/calendar/pull/702

danirabbit commented 2 years ago

@Marukesu can you update this/resolve conflicts since there's now a single binary?

Marukesu commented 2 years ago

Updated the PR, now this will show the dialog in two cases:

Also, the daemon is always started now, so that we can show notifications when the application is open, even if we don't have permission to run in background.

danirabbit commented 2 years ago

Is there a reason to only use the background portal when running in Flatpak? Can we use it all the time?

Marukesu commented 2 years ago

Is there a reason to only use the background portal when running in Flatpak? Can we use it all the time?

The GTK portal backend uses the sandboxed app id to name the autostart file, but for host apps it is empty, so they create an unnamed .desktop that is replaced by others application on host that calls the portal (see flatpak/xdg-desktop-portal#650).

Marukesu commented 2 years ago
  1. Running the flatpak with flatpak run launched the program but did not start the daemon

I can't reproduce this here, starting the application should start the daemon, the only diference from master here is that starting the daemon is done before the --background check.

  1. After giving permission the window closed but the daemon did not start

The last commit should fix that, for some reason, chaining up base.delete_event () was causing an segfault.

  1. It was not possible to launch Calendar from the wingpanel indicator but launching from the dock and Applications Menu worked. (Is this an existing bug with flatpak/wingpanel?)

Looking at the code in the indicator, it tries to launch io.elementary.calendar --show-day, so i don't expect it to work with the sandboxed calendar.

danirabbit commented 1 year ago

@Marukesu wanna update this again and remove the flatpak check since the background portal can work with host apps now? :)

Marukesu commented 1 year ago

@danirabbit this should be good to review again.