flatpak/xdg-desktop-portal

UseIn fallbck is used even if preference is set to none for interfaces within portals.conf file

SoumyaRanjanPatnaik opened this issue · 1 comments

Operating System

Ubuntu 23.10 (mantic)

XDG Desktop Portal version

1.18

XDG Desktop Portal version (Other)

No response

Desktop Environment

Other

Desktop Environment (Other)

Regolith

Expected Behavior

  • If the preferred value for an interface is set to none in portals.conf, the interface should be disabled.
  • If the default preference is set to none, all the interfaces should be disabled, except the ones that explicitly specify some other backend in their preference list

Current Behavior

X-D-P ignores none values in portals.conf file, if the UseIn value is specified by any of the backends

Steps to Reproduce

  1. Install a portals backend that uses the legacy UseIn field in its .portals file (example: X-D-P-gnome)
  2. In your portals.conf file, set the preference for any interface supported by the backend. I used the following for gnome.
    org.freedesktop.impl.portal.Background=none
    
  3. Run /usr/libexec/xdg-desktop-portal -r -v

Result: the interface is not disabled

XDP: Found 'none' in configuration for org.freedesktop.impl.portal.Background

(/usr/libexec/xdg-desktop-portal:81335): xdg-desktop-portal-WARNING **: 19:29:21.131: Choosing gnome.portal for org.freedesktop.impl.portal.Background via the deprecated UseIn key

(/usr/libexec/xdg-desktop-portal:81335): xdg-desktop-portal-WARNING **: 19:29:21.131: The preferred method to match portal implementations to desktop environments is to use the portals.conf(5) configuration file
XDP: Using gnome.portal for org.freedesktop.impl.portal.Background in gnome (fallback)

Anything else we should know?

Setting default to none produces the same behaviour but for all the interfaces provided by the backends with UseIn in their .portal file

Potential fix: #1255