Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add labwc to XDG_CURRENT_DESKTOP to support a portals.conf #1716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcalixte
Copy link
Contributor

The previous UseIn key was deprecated in xdg-desktop-portal 1.17/1.18. It has been superceded by the portals.conf structure so that each desktop can configure the precise desired structure for portals. In addition, support was added to the Desktop Entry Specifications to support a DesktopNames key that login managers will use to set XDG_CURRENT_DESKTOP.

Ref: flatpak/xdg-desktop-portal#955

@Consolatis
Copy link
Member

Consolatis commented Apr 15, 2024

https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals.conf.rst.in#L136C1-L140C32

describes the content of the XDG_CURRENT_DESKTOP env var as:

A colon-separated list of desktop environments, most specific first

However, in this PR the env var is using a semi-colon ; rather than a colon : to separate labwc and wlroots.

Edit:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html in comparison states

$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon.

So using the semi-colon ; in the .desktop file (but not in the env var) seems correct. This is kind of messy.

@rcalixte
Copy link
Contributor Author

https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals.conf.rst.in#L136C1-L140C32

describes the content of the XDG_CURRENT_DESKTOP env var as:

A colon-separated list of desktop environments, most specific first

However, in this PR the env var is using a semi-colon ; rather than a colon : to separate labwc and wlroots.

I'd seen that and I'm not sure what it pertains to, perhaps some environment variable in the portals.conf? (I've not seen this convention in use anywhere yet.)

From the Desktop Entry Specifications:

$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon.

@rcalixte
Copy link
Contributor Author

This is kind of messy.

We're used to this by now. 😄

@Consolatis
Copy link
Member

From the Desktop Entry Specifications:

$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon.

It also states directly before that quote:

If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings.

So using colon : separated content of the env var seems correct (and thus should be fixed in this PR).

@Consolatis
Copy link
Member

With the latest changes the .desktop file now seems wrong, at least compared to how I understand the linked documentation.

@rcalixte
Copy link
Contributor Author

With the latest changes the .desktop file now seems wrong, at least compared to how I understand the linked documentation.

So it's the same value. Depending on your login manager, you can test this by adding the DesktopNames key to your .desktop file before logging in. So these should match, whether a colon or semi-colon. Let me see if I can find other examples in the wild.

@Consolatis
Copy link
Member

The sentence you quoted clearly stated that the .desktop file uses semi-colons to separate the items. Random anecdote here which also uses a trailing ;.

@rcalixte
Copy link
Contributor Author

rcalixte commented Apr 15, 2024

It's the same value. I don't believe there should a semi-colon in one place and a colon in the other.

Here's an example from Budgie's budgie-desktop.desktop.

@rcalixte
Copy link
Contributor Author

This value directly feeds into the environment variable.

@Consolatis
Copy link
Member

Consolatis commented Apr 15, 2024

I usually prefer to implement something based on specs rather than look at what other people do.
The budgie-desktop.desktop you linked actually uses a semi-colon as well.

data/labwc-portals.conf Outdated Show resolved Hide resolved
The previous `UseIn` key was deprecated in xdg-desktop-portal 1.17/1.18.
It has been superceded by the portals.conf structure so that each
desktop can configure the precise desired structure for portals. In
addition, support was added to the Desktop Entry Specifications to
support a `DesktopNames` key that login managers will use to set
XDG_CURRENT_DESKTOP.

* [portals.conf
  Documentation](https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals.conf.rst.in)
* [Example
  sway-portals.conf](https://salsa.debian.org/swaywm-team/sway/-/blob/debian/sid/debian/sway-portals.conf)
* [Desktop Entry
  Specifications](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)

Ref: flatpak/xdg-desktop-portal#955
@Consolatis
Copy link
Member

As I personally don't use desktop portals it would be great if somebody could test this PR and verify that screensharing still works and it doesn't change anything regarding the used portals (e.g. kde ones rather than gtk or the other way around).

@stefonarch
Copy link
Contributor

For LXQt I'm using XDG_CURRENT_DESKTOP=LXQt:labwc:wlroots and according to the testpage screensharing should work.

@jp7677
Copy link
Contributor

jp7677 commented Apr 16, 2024

Not sure if this is relevant here, I've also added org.freedesktop.impl.portal.Inhibit=none, see`#1503 for some background.

@Consolatis
Copy link
Member

Consolatis commented Apr 16, 2024

For LXQt I'm using XDG_CURRENT_DESKTOP=LXQt:labwc:wlroots and according to the testpage screensharing should work.

Is that with

[preferred]
default=wlr;*

stored as /usr/share/xdg-desktop-portal/labwc-portals.conf ?

Although I guess in your case /usr/share/xdg-desktop-portal/lxqt-portals.conf would get priority.
In that case it could be simulated with storing the above as ~/.config/xdg-desktop-portal/labwc-portals.conf.

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.

None yet

4 participants