Package: openbox-gnome-session
Version: 3.6.1-11
Severity: normal
User: xdg-desktop-por...@packages.debian.org
Usertags: portals.conf

xdg-desktop-portal 1.17.x introduces a new way to select which portals will
be used for which desktop environments, modelled on mimeapps.list:

- each desktop environment should provide a file like
  /usr/share/xdg-desktop-portal/gnome-portals.conf

- the filename is ${DESKTOP}-portals.conf where ${DESKTOP} is the desktop
  environment's entry in $XDG_CURRENT_DESKTOP (the same as the DesktopNames
  from /usr/share/{x,wayland-}sessions/*.desktop), folded to lower case

- sysadmins and users can override this via files named portals.conf or
  ${DESKTOP}-portals.conf in various locations like /etc/xdg-desktop-portal
  and ~/.config/xdg-desktop-portal

But as far as I can tell, openbox-gnome-session sets
XDG_CURRENT_DESKTOP=GNOME, so for the purposes of this mechanism, it's
not programmatically distinguishable from a full GNOME session with GNOME
Shell. This is problematic, because gnome-portals.conf in gnome-session
selects portal implementations that are only appropriate for the full
GNOME session.

To reproduce
============

* Start from a basic non-GUI virtual machine (I used autopkgtest-build-qemu)
* Ensure that a user account exists
* # apt install lightdm xorg openbox-gnome-session
* # reboot
* Log in as the user account, selecting "GNOME/Openbox" from the menu of
  possible X11 sessions
* In a parallel ssh login as the same user:
  $ systemctl --user show-environment

(Normally I would say to use a shell inside the X11 environment, but
openbox-gnome-session doesn't currently work because it declares required
components that don't exist - I opened a separate RC bug.)

Expected result
===============

XDG_CURRENT_DESKTOP should be set to a colon-separated sequence of
desktop environment names, most specific first. Because this seems to
be intended to behave like a variant of GNOME Flashback, which is itself
a variant of full GNOME, a good value might be:

XDG_CURRENT_DESKTOP=Openbox-GNOME:GNOME-Flashback:GNOME

This would allow the Openbox GNOME session variant to have its own
desktop-environment-specific mimeapps.list or portals.conf(5), for
example /usr/share/xdg-desktop-portal/openbox-gnome-portals.conf.

Actual result
=============

XDG_CURRENT_DESKTOP is set to "GNOME", the same as a full GNOME Shell
session.

This means that xdg-desktop-portal will use xdg-desktop-portal-gnome for
all interfaces, but some of the functionality of xdg-desktop-portal-gnome
can only work when running under GNOME Shell.

Suggested fix
=============

Fixing the RC bug I opened today (that openbox-gnome-session doesn't start)
will be a prerequisite for usefully fixing this. If it's resolved by
removing openbox-gnome-session, then obviously no further action is needed.

Assuming that openbox-gnome-session is kept, the solution for this bug
would be to add a sequence of semicolon-terminated desktop environment
names to /usr/share/xsessions/openbox-gnome.desktop, perhaps this:

DesktopNames=Openbox-GNOME;GNOME-Flashback;GNOME;

(Note that this is not the same separator as in $XDG_CURRENT_DESKTOP!
It's a semicolon here, as is standard for .desktop file syntax, but it's
a colon in the environment variable.)

And then create a /usr/share/xdg-desktop-portal/openbox-gnome-portals.conf
with whatever portal backends are desired for openbox-gnome-session;
or alternatively, rely on gnome-flashback to provide a
gnome-flashback-portals.conf that this session can fall back to (please
see #1050799 for more information).

Thanks,
    smcv

-- 
This is part of a mass bug filing:
https://lists.debian.org/debian-devel/2023/08/msg00311.html

Reply via email to