Xdg-desktop-portal-kde source picking issues

Am I the only one that has a horrible experience using xdg-desktop-portal-kde?

Here’s a really simple example, add 3 pipewire screen captures using OBS.

  • Make sure to select “allow restoring on future sessions”.
  • Bind all 3 of them to a window and close OBS.
  • Close all 3 windows that you bound the pipewire captures too.
  • Open OBS back up.

You’ll be prompted with all 3 instances of xdg-desktop-portal-kde, while also having no clue which source the belong to. Closing these dialogs will leave you with an empty capture, thus making the restore on future sessions setting useless.

Here’s another situation:

  • Add a pipewire window capture and select any window, being sure to allow resuming on future sessions.
  • Everything should capture as expected.
  • Close the window you had the capture bound to.
  • You will now have a freeze frame of the last frame the window had.
  • Reopen the application
  • You will continue to have a freeze frame of the old window it will not update or hook into the new window unless you reselect the window.

It seems the only situation where the restoring actually works is if you close obs with all other windows still open and then you can open it and it will resume.

One+ year later and this is exactly the same issue I’m facing. I’ll try to fix it with a clanker and see where it goes.

Somehow, the clankers did it… Only works for KDE, requires some internal APIs that still exist on Debian 13 and takes advantages of infrastructure that exists on KDE Portal implementation to provide access to internal screen recording to Spectacle. May or may not work somewhere else.

The plugin resembles how it was to capture a window in X11: you select the app id / x11 window class, title contains strings or any first window of that class and it just captures it. No pop-ups, it even restores the window if closed. Just worked.

I can’t include links for some reason, but it is on my Github profile, at ronoaldo/obs-kwin-capture.