Skip to content

Implement XDG Desktop Portal support#9727

Draft
FifthTundraG wants to merge 3 commits intonextcloud:masterfrom
FifthTundraG:master
Draft

Implement XDG Desktop Portal support#9727
FifthTundraG wants to merge 3 commits intonextcloud:masterfrom
FifthTundraG:master

Conversation

@FifthTundraG
Copy link
Copy Markdown

Adds a framework for adding XDP portals and implements the Background portal for proper autostart.

Fixes flathub/com.nextcloud.desktopclient.nextcloud#18
Related: flathub/com.nextcloud.desktopclient.nextcloud#225

CC @mgallien


This is a draft. There are a few considerations that still have to be made:

  • I have seen that sometimes the filename for the autostart file will be org.chromium.Chromium.desktop instead of com.nextcloud.desktopclient.nextcloud.desktop. It wasn't occurring on c21ff3d, which is before what seems to be a settings page redesign (which I did not notice until merging newer changes lol), so it may be related to that? This also isn't very consistent, it happened once and now it's not anymore.
  • We need to figure out how we want portals to be configured
    • I think that portals should be the default, and if they fail then we fallback to legacy behavior.
    • We could also use a buildflag (something like USE_PORTALS) and make it configurable that way.
  • Utility::hasLaunchOnStartup does not work (and has not worked) in a sandbox. Its usage in generalsettings.cpp was temporarily disabled, as it was preventing XdgPortal::background from being run when the "run on startup" toggle was unchecked, which meant the autostart file was never removed.
    • This check may never be able to work in a sandbox, as the portal API doesn't expose any obvious way to check if the app is already set to start on login.
  • This PR has not yet been tested in an AppImage (i don't know how to build them and have not bothered to learn yet 🙃)

Please keep in mind that I'm quite new to C++ and insanely long buildscripts (lol), so please have grace on any silly mistakes :)

Signed-off-by: FifthTundraG <117035030+FifthTundraG@users.noreply.github.com>
Signed-off-by: FifthTundraG <117035030+FifthTundraG@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement autostart using background portal

1 participant