xdg-desktop-portal is a D-Bus service providing access to desktop-environment-related functionality for applications. It was originally written to provide sandboxed apps (Flatpak, Snap, etc.) with limited access to resources outside their sandbox with user consent, but is increasingly also used by non-sandboxed apps (.deb or equivalent) as a desktop-environment-independent interface to features like screen-sharing that are otherwise difficult to implement in a cross-desktop way.
xdg-desktop-portal itself does not contain any desktop-environment-specific code, and is shared between all desktop environments. However, a lot of what it does requires use of desktop-environment-specific mechanisms or user interface conventions. To allow for that, it contacts a desktop-specific backend (x-d-p-gtk, x-d-p-gnome, x-d-p-kde and so on) and uses that to provide its full functionality. In Debian 12, if xdg-desktop-portal does not find a suitable backend for the current desktop environment, it would fall back to trying *any* backend. This meant that all backends needed to be prepared to run in an environment where their functionality cannot actually work, which is rarely tested, leading to undesired situations where a desktop environment's backend can cause bugs (such as crashes or slow application startup) while running different desktop environments. xdg-desktop-portal 1.17.x is now available in experimental, and this version contains upstream changes so that desktop environments can have more control over the backends they use. As described in <https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals-conf.rst>, the recommendation is now that each desktop environment should provide a file listing its preferred backends, similar to the one added by <https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/95/diffs> in GNOME. In a future version of xdg-desktop-portal, installing a portals.conf(5) file is likely to become a requirement for desktop environments that want to have working portal interfaces. For the moment, there is some backwards-compatibility to keep existing desktop environments mostly working (see below). I'm intending to re-upload x-d-p 1.17.x to unstable soon. Packages affected ================= Any package that registers itself as an X11 or Wayland desktop session (/usr/share/xsessions/*.desktop, /usr/share/wayland-sessions/*.desktop) is potentially affected. I attach a dd-list of packages that register these files (excluding gnome-session, which I already changed). As a lower priority, any other session manager, window manager or other desktop-environment-like thing that sets the XDG_CURRENT_DESKTOP environment variable could also participate in this mechanism. I don't intend to mass-file bugs for these in any systematic way. I intend to prioritize opening bugs for the major desktop environments that have a task-foo-desktop metapackage: cinnamon, gnome-flashback, kde, lxde, lxqt, mate, xfce. For task-gnome-desktop, I already uploaded gnome-session 44.0-3 with <https://salsa.debian.org/gnome-team/gnome-session/-/commit/b201c9c40e3adc7bf0b1c3504bef4c8602aac31d> included in it - that's an example of the sort of changes that are needed. Action to be taken ================== If the desktop environment is independent of any others, with no ":" in $XDG_CURRENT_DESKTOP (like GNOME, KDE Plasma, Cinnamon) then it should: - take the single string that it uses in XDG_CURRENT_DESKTOP (GNOME, KDE, X-Cinnamon) - fold it to lower case (gnome, kde, x-cinnamon) - install /usr/share/xdg-desktop-portal/${desktop}-portals.conf in either the package that provides the desktop session or one of its dependencies - in that file, describe the portal backends that xdg-desktop-portal users should normally be using while logged in to this desktop environment If the desktop environment behaves like a variant of another desktop environment and sets XDG_CURRENT_DESKTOP to a ":"-separated sequence of decreasingly specific names (like Budgie, which sets XDG_CURRENT_DESKTOP to "Budgie:GNOME") then it has two choices: 1. Behave like an independent desktop environment by installing its own ${desktop}-portals.conf, for example Budgie could install budgie-portals.conf 2. Behave like its parent desktop environment and accept the parent desktop environment's choice of backends, for example Budgie could rely on GNOME's gnome-portals.conf The correct choice depends on how similar the desktop environment is to its parent. I suspect that GNOME Classic (in the gnome-shell-extensions package) is similar enough to the default GNOME environment that it can safely rely on gnome-portals.conf, but Budgie and GNOME Flashback are sufficiently different that they will probably need their own desktop-specific *-portals.conf. A desktop-specific *-portals.conf can either be provided by the upstream project or by the Debian maintainer. It will usually be appropriate to try to send this change upstream. For desktop environment maintainers who are familiar with the use of mimeapps.list to select preferred desktop-specific MIME handlers: the portals.conf(5) search path is intentionally very similar. For the more complete / less self-assembled desktop environments, it would also be a good idea to declare a Depends or Recommends on the desired portal backend in either the desktop session itself or a larger metapackage, particularly if it's something other than x-d-p-gtk. GNOME and KDE both do this already, and Sway has a Suggests on x-d-p-wlr. Customized and user-specific desktop environments ================================================= If a sysadmin or user has constructed their own desktop environment from smaller components, has customized their environment, or wishes to use portal backends that are not the ones recommended by their desktop environment maintainer, they can write similar portals.conf(5) files to set up whatever portals they prefer, and install them into /etc/xdg-desktop-portal or ~/.config/xdg-desktop-portal. Please see <https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals-conf.rst> for more details. In xdg-desktop-portal (>= 1.17) the same information is installed as portals.conf(5) and referred to by debian/NEWS. If the desktop environment does not set the XDG_CURRENT_DESKTOP environment variable in the D-Bus/systemd activation environment, the sysadmin or user will need to either use a portals.conf with no desktop environment prefix, or set XDG_CURRENT_DESKTOP to a suitable value as a prerequisite for creating a desktop-specific portals.conf(5). Backwards-compatibility ======================= If no portals.conf(5) appropriate for the current desktop environment is found, xdg-desktop-portal will fall back to checking the older UseIn= field in each backend's .portal files, with a warning. For example, this should be enough to get the desired portal backend in KDE Plasma. This mechanism will probably be removed eventually by upstream. As a Debian-specific change, if xdg-desktop-portal does not find any backend that declares that it should be used in the current desktop environment, xdg-desktop-portal will fall back to trying to use xdg-desktop-portal-gtk, again with a warning. This is because despite originally being designed for GNOME only, x-d-p-gtk has traditionally been treated like a reference implementation of a portal backend, and is the backend that has traditionally been installed by users of desktop environments that do not yet have their own backend. This is a short-term Debian-specific change, and we plan to remove it when the major desktop environments have had a chance to add a portals.conf(5). smcv
Albin Tonnerre <lu...@debian.org> e17 (U) Alexander Wirt <formo...@debian.org> subtle Alf Gaida <aga...@siduction.org> lxqt-session (U) Andrea Bolognani <e...@kiyuko.org> spectrwm Andreas Metzler <ametz...@debian.org> e17 (U) wmaker (U) Andrew Lee (李健秋) <ajq...@debian.org> lxde-common (U) lxqt-session (U) Andriy Grytsenko <and...@rep.kiev.ua> lxde-common (U) Arnaud Ferraris <aferra...@debian.org> plasma-mobile (U) Arnaud Ferraris <arnaud.ferra...@gmail.com> phosh (U) Aron Xu <a...@debian.org> ukui-session-manager (U) Arun Kumar Pariyar <a...@debian.org> cutefish-core Arun Kumar Pariyar <openarung...@gmail.com> cutefish-core Aurélien COUDERC <couc...@debian.org> plasma-bigscreen (U) plasma-workspace (U) Axel Beckert <a...@debian.org> flwm Benda Xu <hero...@gentoo.org> stumpwm (U) Benda Xu <o...@debian.org> stumpwm (U) Birger Schacht <bir...@debian.org> sway (U) Boyuan Yang <by...@debian.org> wayfire ChangZhuo Chen (陳昌倬) <czc...@debian.org> lxqt-session (U) Chris Boyle <c...@debian.org> aewm++ sapphire Christoph Egger <christ...@debian.org> herbstluftwm Christoph Martin <mar...@uni-mainz.de> cinnamon (U) Christopher James Halse Rogers <r...@ubuntu.com> mir (U) Clint Adams <cl...@debian.org> xmonad (U) David Mohammed <fossfree...@ubuntu.com> budgie-desktop Debian Cairo-dock Maintainers <team+pkg-cairo-dock-de...@tracker.debian.org> cairo-dock Debian Cinnamon Team <debian-cinna...@lists.debian.org> cinnamon Debian Common Lisp Team <debian-common-l...@lists.debian.org> stumpwm Debian Edu Packaging Team <debian-edu-pkg-t...@lists.alioth.debian.org> impressive-display surf-display Debian Emacsen team <debian-emac...@lists.debian.org> exwm Debian GNOME Maintainers <pkg-gnome-maintain...@lists.alioth.debian.org> gnome-flashback gnome-shell-extensions Debian Haskell Group <pkg-haskell-maintain...@lists.alioth.debian.org> xmonad Debian i3 maintainers <team...@tracker.debian.org> i3-wm Debian LXDE Maintainers <pkg-lxde-maintain...@lists.alioth.debian.org> lxde-common Debian Mir Team <team+...@tracker.debian.org> mir Debian Multimedia Maintainers <debian-multime...@lists.debian.org> kodi Debian Pkg-e Team <pkg-e-de...@lists.alioth.debian.org> e17 Debian QA Group <packa...@qa.debian.org> blackbox ctwm lwm miwm pekwm Debian Qt/KDE Maintainers <debian-qt-...@lists.debian.org> plasma-bigscreen plasma-workspace Debian Remote Maintainers <debian-rem...@lists.debian.org> remmina Debian Sugar Team <pkg-sugar-de...@lists.alioth.debian.org> sugar Debian UBports Team <team+ubpo...@tracker.debian.org> lomiri-session mir (U) Debian Window Maker Team <pkg-wmaker-de...@lists.alioth.debian.org> wmaker Debian Window Maker Team <team+wma...@tracker.debian.org> wmaker Debian X Strike Force <debia...@lists.debian.org> twm weston Debian Xfce Maintainers <debian-x...@lists.debian.org> lightdm xfce4-session Debian+Ubuntu MATE Packaging Team <debian-m...@lists.debian.org> mate-session-manager DebianOnMobile Maintainers <debian-on-mobile-maintain...@alioth-lists.debian.net> phosh plasma-mobile sxmo-utils Desmond O. Chang <doch...@gmail.com> stumpwm (U) Dima Kogan <dko...@debian.org> notion Dmitry E. Oboukhov <un...@debian.org> fluxbox Dmitry Shachnev <mity...@debian.org> gnome-flashback (U) Dominik George <naturesha...@debian.org> impressive-display (U) Doug Torrance <dtorra...@piedmont.edu> wmaker (U) Eduard Bloch <bl...@debian.org> icewm Emilio Pozuelo Monfort <po...@debian.org> weston (U) Fabio Fantoni <fantonifa...@tiscali.it> cinnamon (U) Graham Inggs <gin...@debian.org> motif Gürkan Myczko <gur...@phys.ethz.ch> amiwm Gürkan Myczko <t...@debian.org> amiwm handsome_feng <jianfen...@ubuntukylin.com> ukui-session-manager (U) Hugo Lefeuvre <h...@debian.org> dwm Héctor Orón Martínez <zu...@debian.org> weston (U) Iain Lane <la...@debian.org> gnome-shell-extensions (U) Ilias Tsitsimpis <ilias...@debian.org> xmonad (U) Jaimos Skriletz <jaimosskril...@gmail.com> fvwm fvwm3 Jakob Haufe <su...@debian.org> i3-wm (U) James McDonald <ja...@jamesmcdonald.com> cwm Jan Lübbe <jlue...@debian.org> e17 (U) Jari Aalto <jari.aa...@cante.net> lwm Jeremy Bicha <jbi...@debian.org> gnome-shell-extensions (U) Jeremy Bicha <jbi...@ubuntu.com> gnome-flashback (U) gnome-shell-extensions (U) Joachim Breitner <nome...@debian.org> xmonad (U) Jochen Sprickerhof <jspri...@debian.org> sxmo-utils (U) John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de> mate-session-manager (U) Jonas Smedegaard <d...@jones.dk> sugar (U) Jose M Calhariz <j...@calhariz.com> sawfish Joshua Peisach <itzswirlz2...@outlook.com> cinnamon (U) Kylin Team <team+ky...@tracker.debian.org> ukui-session-manager Laurent Bigonville <bi...@debian.org> gnome-shell-extensions (U) Louis Bettens <lo...@bettens.info> xmonad (U) LXQt Packaging Team <pkg-lxqt-de...@lists.alioth.debian.org> lxqt-session LXQt Packaging Team <team+l...@tracker.debian.org> lxqt-session Marcin Owsiany <porri...@debian.org> bambam Marco Mattiolo <marco.matti...@hotmail.it> plasma-mobile (U) Marco Trevisan (Treviño) <ma...@ubuntu.com> gnome-shell-extensions (U) Margarita Manterola <ma...@debian.org> cinnamon (U) Marius Gripsgard <mariog...@debian.org> mir (U) Marius Gripsgard <mar...@ubports.com> lomiri-session (U) mir (U) Martin <deba...@debian.org> exwm (U) Mateusz Łukasik <mat...@linuxmint.pl> evilwm openbox Mats Erik Andersson <mats.anders...@gisladisker.se> w9wm windowlab Matteo Bini <matteo...@tiepi.it> dwm Matteo F. Vescovi <m...@debian.org> remmina (U) Maximiliano Curia <m...@debian.org> cinnamon (U) Michael Stapelberg <stapelb...@debian.org> i3-wm i3-wm (U) Mike Gabriel <sunwea...@debian.org> impressive-display (U) lomiri-session (U) mate-session-manager (U) mir (U) surf-display (U) weston (U) Milan Zamazal <p...@debian.org> stumpwm (U) Moray Allan <mo...@debian.org> matchbox-common Nicolas Braud-Santoni <ni...@debian.org> sway (U) nicoo <ni...@debian.org> sway (U) Nobuhiro Iwamatsu <iwama...@debian.org> bspwm cairo-dock (U) Norbert Preining <norb...@preining.info> cinnamon (U) plasma-workspace (U) Patrick Franz <delta...@debian.org> plasma-bigscreen (U) plasma-workspace (U) Patrick Franz <patfr...@gmail.com> plasma-workspace (U) Paul Gevers <elb...@debian.org> motif (U) Paul Tagliamonte <paul...@debian.org> fluxbox (U) Peter Van Eynde <pvane...@debian.org> stumpwm (U) Phil Brooke <p...@debian.org> fvwm1 Raphael Mota Ramos <raphaelmota...@gmail.com> bspwm (U) Reiner Herrmann <rei...@reiner-h.de> awesome Robert Luberda <rob...@debian.org> afterstep Ross Vandegrift <rvandegr...@debian.org> e17 (U) Ryan Kavanagh <r...@debian.org> xmonad (U) Samuel Henrique <samuel...@debian.org> jwm Santiago Ruano Rincón <santi...@debian.org> sugar (U) Scarlett Moore <sgmo...@debian.org> plasma-bigscreen (U) Scarlett Moore <sgmo...@kde.org> plasma-workspace (U) Simon Quigley <tsimo...@debian.org> mir (U) Stefano Karapetsas <stef...@karapetsas.com> mate-session-manager (U) Sway and related packages team <team+swa...@tracker.debian.org> sway Tzafrir Cohen <tzaf...@debian.org> sxmo-utils (U) Vangelis Mouhtsis <vange...@gnugr.org> mate-session-manager (U) Vasyl Gello <vasek.ge...@gmail.com> kodi (U) Vincent Bernat <ber...@debian.org> fvwm-crystal Youhei SASAKI <uwab...@gfd-dennou.org> cairo-dock (U) Yves-Alexis Perez <cor...@debian.org> lightdm (U) xfce4-session (U)