Bug 484731 - When manually launching KDE's portal in Hyprland, file picker randomly gets stuck and stops working
Summary: When manually launching KDE's portal in Hyprland, file picker randomly gets s...
Status: REPORTED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-30 00:11 UTC by Vaxry
Modified: 2024-04-05 14:06 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Logs from xdpk (3.36 KB, text/plain)
2024-03-30 00:11 UTC, Vaxry
Details
xdpk's bt -full when stuck (3.36 KB, text/plain)
2024-04-03 00:06 UTC, Vaxry
Details
xdpk's bt -full when stuck (fixed) (25.23 KB, text/plain)
2024-04-03 08:44 UTC, Vaxry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vaxry 2024-03-30 00:11:51 UTC
Created attachment 167927 [details]
Logs from xdpk

SUMMARY

I am running Hyprland, and want to have the nice KDE file picker via xdp.

I've configured xdp like so in my hyprland-portals.conf:
```
[preferred]
default=hyprland
org.freedesktop.impl.portal.FileChooser=kde
```

Two issues, possibly connected:
 - When launching xdp, the KDE portal gets stuck for about 20s. This is highly annoying.
 - Even when launched, sometimes, the file picker just... won't open, ever. Seems like xdpk just... died.

STEPS TO REPRODUCE

I have a script for forcing the restart like so:
```sh
#!/bin/bash
killall xdg-desktop-portal-hyprland
killall xdg-desktop-portal-kde
killall xdg-desktop-portal
QT_LOGGING_RULES=*=true strace /usr/lib/xdg-desktop-portal-kde 2>&1 &
sleep 1
/usr/lib/xdg-desktop-portal &
```

Launching this script (or, well, getting sysd to do it on start) will produce the above issues.

OBSERVED RESULT

I've attached the logs from stracing and setting QT_LOGGING_RULES=*=true from both occurrences (stuck at start and stopping working)

Worth noting that even after those logs it sometimes gets restarted automatically and works, sometimes doesn't...?

EXPECTED RESULT

Well, none of the two above.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch, Hyprland, XDPK 6.0.3
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version: frameworkintegration 6.0.0-1
Qt Version: 6.6.2 it seems

If there's anything else you'd like me to attach, I'd be glad to help.
Comment 1 Aleix Pol 2024-04-02 21:35:54 UTC
Can you maybe attach gdb and get a backtrace when it's stuck? it would help get a better idea of what could be happening.
Comment 2 Vaxry 2024-04-03 00:06:33 UTC
Created attachment 168073 [details]
xdpk's bt -full when stuck

Absolutely, attaching as a file because it's huge
Comment 3 Vaxry 2024-04-03 08:44:28 UTC
Created attachment 168081 [details]
xdpk's bt -full when stuck (fixed)

Oops, just realized I attached the wrong thing. My bad.
Comment 4 Nicolas Fella 2024-04-05 13:13:58 UTC
It's stuck because the qxdgdesktopportal platform plugin makes a DBus call to the portal, but since it's the portal process itself making the call it deadlocks.

I'm inclined to say this setup is not something we support since xdg-desktop-portal-kde wasn't designed to run outside of Plasma
Comment 5 Vaxry 2024-04-05 14:06:45 UTC
is there any remedy to fix this, though?

I realize it wasn't designed to run outside of plasma, but just like there exists -gtk, a qt variant seems reasonable, that's why some people go to -kde.