#1050959 fvwm: please set XDG_CURRENT_DESKTOP and use it to configure xdg-desktop-portal

Package:
fvwm
Source:
fvwm
Description:
F(?) Virtual Window Manager
Submitter:
Simon McVittie
Date:
2026-01-10 10:58:56 UTC
Severity:
normal
#1050959#5
Date:
2023-08-31 19:27:18 UTC
From:
To:
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/fvwm-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, fvwm doesn't set XDG_CURRENT_DESKTOP, so for
the purposes of this mechanism, it's not programmatically distinguishable
from any other desktop environment or window manager.

XDG_CURRENT_DESKTOP is also used in pre-existing freedesktop.org standards
like the OnlyShowIn/NotShowIn fields for .desktop files, and the ability to
provide a desktop-environment-specific mimeapps.list. Setting
XDG_CURRENT_DESKTOP would allow fvwm to participate in those
specifications.

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 fvwm
* reboot
* Log in as the user account, selecting Fvwm from the menu of
  possible X11 sessions
* Open a terminal and run:
  env | grep XDG_CURRENT_DESKTOP
  systemctl --user show-environment

(It's the systemd activation environment that matters here, more than
`env`, because xdg-desktop-portal will typically be run as a systemd
user service.)

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

XDG_CURRENT_DESKTOP should be set to a colon-separated sequence of
desktop environment names, most specific first. fvwm seems to be its
own thing rather than being based on another desktop environment, so

    XDG_CURRENT_DESKTOP=Fvwm

would seem appropriate.

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

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

XDG_CURRENT_DESKTOP is unset.

This means that xdg-desktop-portal configuration can only be done via a
non-desktop-specific portals.conf, but that's not really something that a
non-opinionated distribution like Debian can usefully ship in a centralized
way, so each user of fvwm who wants a working xdg-desktop-portal will
have to configure it themselves.

At the moment, this is mitigated by xdg-desktop-portal (>= 1.17) having
been patched to fall back to xdg-desktop-portal-gtk as a last-resort
desktop-environment-specific backend, but hard-coding that implementation
isn't really something we should be doing centrally (and the idea was
rejected upstream), so I intend to remove that patch before trixie
is released.

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

Normally my advice would be to add a sequence of semicolon-separated
desktop environment names to /usr/share/xsessions/fvwm.desktop, perhaps
just "Fvwm":

DesktopNames=Fvwm;

(Some similar examples: icewm and windowmaker use "ICEWM" and
"WindowMaker" in their equivalent xsessions files.)

And then create a /usr/share/xdg-desktop-portal/fvwm-portals.conf
with whatever portal backends are desired for a fvwm session,
for example perhaps this:

[preferred]
default=gtk;

A complicating factor for fvwm is that fvwm, fvwm-crystal, fvwm1 and
fvwm3 are all variations of fvwm, so they can't all own the filename
/usr/share/xdg-desktop-portal/fvwm-portals.conf. One way to it would
either have to be in some shared package that they all depend on, or
managed non-exclusively somehow (alternatives?).

Or, if it's desirable to be able to distinguish between all these fvwm
variants, they could have a fully-qualified name in the xsessions/*.desktop
file:

DesktopNames=Fvwm2;Fvwm;

which would result in "XDG_CURRENT_DESKTOP=Fvwm2:Fvwm" in the environment,
and xdg-desktop-portal trying to load files like
/usr/share/xdg-desktop-portal/fvwm2-portals.conf, falling back to
/usr/share/xdg-desktop-portal/fvwm-portals.conf if those don't exist.

Please see portals.conf(5) or its source code
https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals-conf.rst
for full details.

Thanks,
    smcv

#1050959#10
Date:
2026-01-10 10:10:29 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.