Skip to content

feat: Implement Background portal for Flatpak apps#245

Closed
ZeusCraft10 wants to merge 1 commit intopop-os:masterfrom
ZeusCraft10:feature/background-portal
Closed

feat: Implement Background portal for Flatpak apps#245
ZeusCraft10 wants to merge 1 commit intopop-os:masterfrom
ZeusCraft10:feature/background-portal

Conversation

@ZeusCraft10
Copy link

Description

Implements the Background portal (org.freedesktop.impl.portal.Background) for COSMIC.

This allows Flatpak applications to request permission to run in the background, resolving the "Access Denied" error in apps like EasyEffects.

Fixes pop-os/cosmic-epoch#2854

Changes

  • Added src/background.rs - New file implementing the Background D-Bus interface
  • Modified src/main.rs - Added module declaration
  • Modified src/subscription.rs - Registered interface and added event handling
  • Modified src/app.rs - Added message handling and dialog view
  • Modified data/cosmic.portal - Added Background interface to supported interfaces
  • Modified i18n/en/xdg_desktop_portal_cosmic.ftl - Added dialog strings

Implemented Methods

  • RequestBackground - Shows permission dialog, returns whether background is allowed
  • SetStatus - Logs status message (placeholder for future UI integration)
  • version property - Returns version 2

Limitations

  • AutoStart is not yet implemented (always returns autostart: false)
  • Full autostart support can be added in a follow-up PR

Testing

  • Dialog should appear when app requests background permission
  • "Allow" grants permission, "Deny" rejects request

Implements org.freedesktop.impl.portal.Background D-Bus interface to allow
Flatpak applications to request background execution permissions.

This resolves the 'Access Denied' error in apps like EasyEffects when
attempting to enable background/autostart functionality.

Changes:
- Added src/background.rs with RequestBackground and SetStatus methods
- Registered Background interface in subscription.rs
- Added message handling in app.rs
- Updated cosmic.portal with Background interface
- Added i18n strings for permission dialog

Note: AutoStart returns false as full autostart support requires
managing .desktop files, which can be added in a follow-up PR.

Fixes: pop-os/cosmic-epoch#2854
@mmstick mmstick requested review from a team January 5, 2026 23:43
Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After installing a70d8db and rebooting, I still get the same error message when attempting to enable the Autostart on login option in Easy Effects:

Screenshot_2026-01-07_12-51-05

@ZeusCraft10 Does this work in your environment? Is there any other information I should know for testing?

@therealmate
Copy link
Contributor

Isn't this the same as #70?

After installing a70d8db and rebooting, I still get the same error message when attempting to enable the Autostart on login option in Easy Effects:
Screenshot_2026-01-07_12-51-05

@ZeusCraft10 Does this work in your environment? Is there any other information I should know for testing?

"AutoStart is not yet implemented"

@jacobgkau
Copy link
Member

"AutoStart is not yet implemented"

I see that that was stated in this PR's description. The PR description also stated under "testing" that an allow/deny dialog should be shown, which I'm not seeing.

It sounds like #70 may have actually implemented autostart, but that PR's got some conflicts that would need to be resolved now.

@ZeusCraft10
Copy link
Author

Hey @jacobgkau, thanks for giving this a spin! You're totally right - the dialog doesn't show because Easy Effects is hitting the autostart path, which I left stubbed out (returns false always, as I mentioned in the description).

@therealmate good catch on #70! I honestly didn't realize that PR existed - looks like joshuamegnauth54 already did the heavy lifting there, including the actual desktop file stuff that Easy Effects needs.

Going to close this one since #70 is way further along. Happy to help test or fix conflicts there if y'all need an extra pair of hands. My bad for the duplicate work!

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.

Flatpak Background Portal prompt missing (EasyEffects "Access Denied")

3 participants