]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Add labwc to XDG_CURRENT_DESKTOP to support a portals.conf (#1716)
authorRick Calixte <10281587+rcalixte@users.noreply.github.com>
Tue, 1 Oct 2024 20:33:45 +0000 (16:33 -0400)
committerGitHub <noreply@github.com>
Tue, 1 Oct 2024 20:33:45 +0000 (21:33 +0100)
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

data/labwc-portals.conf [new file with mode: 0644]
data/labwc.desktop
docs/environment
meson.build
src/config/session.c

diff --git a/data/labwc-portals.conf b/data/labwc-portals.conf
new file mode 100644 (file)
index 0000000..1a45f71
--- /dev/null
@@ -0,0 +1,2 @@
+[preferred]
+default=wlr;*
index 63ffcfffda5f512e7ad004d7dc6bef5faa1ea00c..5b25c814012a1b0e412ec47773c3d0b19aa59b0a 100644 (file)
@@ -4,4 +4,4 @@ Comment=A wayland stacking compositor
 Exec=labwc
 Icon=labwc
 Type=Application
-DesktopNames=wlroots
+DesktopNames=labwc;wlroots
index ad574bd90b88427bb637d03d5e86a0f86b7a37d7..90d7456a44af80f622e0cd2a469d7e5d1b99ace4 100644 (file)
 
 ##
 ## This allows xdg-desktop-portal-wlr to function (e.g. for screen-recording).
-## It is automatically set to "wlroots" by labwc though, so it is only
+## It is automatically set to "labwc:wlroots" by labwc though, so it is only
 ## included here for completeness. Again, labwc will not over-write an
 ## already set environment variable, so if you need it set to something else,
 ## then uncomment and adjust.
 ##
 
-# XDG_CURRENT_DESKTOP=wlroots
+# XDG_CURRENT_DESKTOP=labwc:wlroots
 
 ##
 ## This causes a virtual output to be created automatically whenever there
index e5ccae58311642b8491bc7523839d9d464c70a0b..249c6e683bb9d1b78d01267c23c0938a9d3887d1 100644 (file)
@@ -174,6 +174,8 @@ executable(
 
 install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
 
+install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal')
+
 icons = ['labwc-symbolic.svg', 'labwc.svg']
 foreach icon : icons
   icon_path = join_paths('data', icon)
index b52b717aae1809966f160aaade54a7b9c8355531..3238369f69776b8f05a59c96a3c8b83a5c8bd43d 100644 (file)
@@ -227,7 +227,7 @@ session_environment_init(void)
         * May be overridden either by already having a value set or by the user
         * supplied environment file.
         */
-       setenv("XDG_CURRENT_DESKTOP", "wlroots", 0);
+       setenv("XDG_CURRENT_DESKTOP", "labwc:wlroots", 0);
 
        /*
         * Set default for _JAVA_AWT_WM_NONREPARENTING so that Java applications