-
Notifications
You must be signed in to change notification settings - Fork 51
Set XDG_CURRENT_DESKTOP for new units started by user service manager #605
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
base: master
Are you sure you want to change the base?
Conversation
This fixes the problem that XDG Desktop Portal does not use the LXQt backend under LXQt session.
|
I'm not sure about this. Testing on a clean user and openbox the portal isn't loaded with or without this. It needs here |
|
@stefonarch: Are you sure? What happens if you replace the command with this? |
|
This looks working at a first test. But that portal stuff is weird IMO always a little bit. |
|
The XDG Desktop Portal documentation recommends these two commands: And labwc already do this: This is why the proper portal backend is loaded when using labwc, but not when using other window managers/compositors. |
|
On a second test it didn't work, with a cold boot. Labwc does it well, Hyprland too, niri not (with LXQt), the others I don't remember atm, kwin_wayland has issues too. What I see isn't logical, and I remember similar behavior on niri:
|
|
Another 2 reboots and tests, it works fine with niri, and it worked twice now with x11 too. Tested cold boot into kwin_wayland - it fixes the not loading there too. |
The portal is correctly loaded here on both labwc and kwin_wayland without needing any patch. labwc has always been OK. They may have made a change to KWin recently; I see new lines about portals in my log when I log into LXQt+kwin_wayland. Anyway, I think we need @palinek to look into this. |
|
Are you sure? Try to boot directly into kwin_wayland. |
Yes. I remember we didn't know why it worked for me but not for you. Also, some things seem to have changed in KWin 6.4.X in a positive direction. |
|
BTW, don't forget that, even if this change can have a nonrandom effect on Wayland, its place should be changed in lxqt/lxqt-wayland-session#90: logically, it should come after the last instance of |
Now I updated that pull request to call this command after every XDG_CURRENT_DESKTOP export. |
|
If it works for both of you, that's a good sign. @palinek, can it have any side effect? |
|
|
||
| # set environment variables for new units started by user service manager | ||
| if command -v systemctl >/dev/null; then | ||
| systemctl --user import-environment XDG_CURRENT_DESKTOP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we push the variable into the systemd environment block for the sake of running lxqt-session, then we probably should also remove it (systemctl --user unset-environment) after lxqt-session's end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's needed, because it seems that these variables are imported to the systemd user environment anyway, the systemctl --user show-environment command lists them after login. This explicit import just ensures that it happens early enough before the XDG Desktop Portal service starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember login from tty with startx with xfwm4 it was needed, but I'm not sure if DMs play a role in set/unset here too.
This fixes the problem that XDG Desktop Portal does not use the LXQt backend under LXQt session.