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

Update README.md #25

Merged
merged 1 commit into from
Jan 13, 2024
Merged

Update README.md #25

merged 1 commit into from
Jan 13, 2024

Conversation

stefonarch
Copy link
Member

No description provided.

@stefonarch
Copy link
Member Author

stefonarch commented Jan 11, 2024

Any objections?
Related #23

@tsujan
Copy link
Member

tsujan commented Jan 11, 2024

None from me if you know that it works (I don't use portals).

@stefonarch stefonarch merged commit 66975dd into master Jan 13, 2024
@stefonarch stefonarch deleted the stefonarch-patch-2 branch January 13, 2024 07:37
@q234rty
Copy link

q234rty commented Jan 13, 2024

TL;DR:
We want

hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP=LXQt

in startlxqt.

I don't think writing a config file into ~/.config/xdg-desktop-portal/lxqt-portals.conf currently works under a lxqt session as started in https://github.com/lxqt/lxqt-session/blob/master/startlxqt.in

The issue is, xdg-desktop-portal does not "know" it's a lxqt session, so it won't read lxqt-portals.conf. The portal relies on the env var XDG_CURRENT_DESKTOP for that, and while the startlxqt script exports said env var, xdg-desktop-portal is usually started via dbus activation, which does not use the same environment.

The command mentioned above tries to update the dbus activation environment as well.

As a workaround before said change is released, one can use ~/.config/xdg-desktop-portal/portals.conf instead, as x-d-p reads that when XDG_CURRENT_DESKTOP is not set.

Edit: Apparently https://github.com/lxqt/lxqt-session/blob/a7e61a3726758b5503b38083c43c897a3d4143be/lxqt-session/src/sessionapplication.cpp#L347 imports the whole env, it's probably a race between that and xdg-desktop-portal being started via activation then.

Edit 2: Qt has portal integration enabled by default in https://invent.kde.org/qt/qt/qtbase/-/blob/kde/5.15/src/platformsupport/services/genericunix/qgenericunixservices.cpp#L389 , as lxqt-session is itself a QApplication, this triggers the dbus activation of xdg-desktop-portal, breaking the env vars of said process since SessionApplication::updateDBusEnvironment hasn't yet been called . We need to set QT_NO_XDG_DESKTOP_PORTAL=1 before creating the QApplication and remember to unset it after the dbus env vars are setup.

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.

3 participants