Bug 448423 - Screen sharing fails to work on apps that use portal + pipewire to capture the screen
Summary: Screen sharing fails to work on apps that use portal + pipewire to capture th...
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.23.90
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords:
: 448781 449035 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-14 00:50 UTC by Samuel Reddy
Modified: 2022-01-25 13:29 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Reddy 2022-01-14 00:50:47 UTC
SUMMARY:
Programs that use portals to capture the screen on Wayland(OBS Studio for example) are no longer able to capture the screen due to this bug. This bug does not show the screen share dialog, preventing access to the screen.

STEPS TO REPRODUCE:
1. Open a app that uses portals for screen capture(OBS on Wayland)
2. No screen share permission dialog

OBSERVED RESULT:
There is no screen share dialog

EXPECTED RESULT:
There should be a screen share dialog asking you to give access to the screen

SOFTWARE/OS VERSIONS:
Operating System: Arch Linux
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.0-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 5 3450U with Radeon Vega Mobile Gfx
Memory: 5.7 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics

ADDITIONAL INFORMATION:
I used the kde-unstable repo on Arch to use the Plasma 5.24 beta
Comment 1 Jan Grulich 2022-01-14 07:19:01 UTC
Hi Samuel,

can you try to start xdg-desktop-portal-kde with "QT_LOGGING_RULES='xdp*.debug=true'" and attach here the output while you try to share a screen?

CC Aleix: Could this be related to your changes to use QML dialogs from plasma-workspace?
Comment 2 Aleix Pol 2022-01-14 10:55:44 UTC
It might? It's working fine on my system with OBS and otherwise, so there should be something more.
Comment 3 Patrick Silva 2022-01-14 20:05:46 UTC
Can confirm the problem with OBS on my Arch after update to Plasma 5.24 beta and on neon unstable.
Comment 4 Nate Graham 2022-01-14 21:58:33 UTC
Works with me with git master xdg-desktop-portal-kde. Notably it does not work with 5.23's xdg-desktop-portal-kde, which dies on launch for me:

> QT_LOGGING_RULES='xdp*.debug=true' /usr/libexec/xdg-desktop-portal-kde
> xdp-kde: Failed to register org.freedesktop.impl.portal.desktop.kde service

But the current git master version works for me.
Comment 5 Nate Graham 2022-01-14 22:02:06 UTC
Never mind, that's because another one was open. Here's the real logging output:

QT_LOGGING_RULES='xdp*.debug=true' /usr/libexec/xdg-desktop-portal-kde
xdp-kde: Desktop portal registered successfully
xdp-kde-wayland-integration: Registry initialized
xdp-kde-wayland-integration: Adding output:
xdp-kde-wayland-integration:     manufacturer:  "unknown"
xdp-kde-wayland-integration:     model:  "eDP-1-unknown"
xdp-kde-wayland-integration:     resolution:  QSize(3840, 2160)
xdp-kde-settings: ReadAll called with parameters:
xdp-kde-settings:     groups:  ("org.kde.kdeglobals.*")
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "menuFont"
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "font"
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.WM"
xdp-kde-settings:     key:  "activeFont"
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "toolBarFont"
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "smallestReadableFont"
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "fixed"
xdp-kde-screencast: CreateSession called with parameters:
xdp-kde-screencast:     handle:  "/org/freedesktop/portal/desktop/request/1_1019/obs1"
xdp-kde-screencast:     session_handle:  "/org/freedesktop/portal/desktop/session/1_1019/obs1"
xdp-kde-screencast:     app_id:  "com.obsproject.Studio"
xdp-kde-screencast:     options:  QMap()
xdp-kde-screencast: zkde_screencast_unstable_v1 does not seem to be available
xdp-kde-session: "org.freedesktop.impl.portal.Session"
xdp-kde-session: "Close"
xdp-kde-session: "/org/freedesktop/portal/desktop/session/1_1019/obs1"



Notable bit:

> xdp-kde-screencast: zkde_screencast_unstable_v1 does not seem to be available
Comment 6 Aleix Pol 2022-01-15 01:24:10 UTC
> zkde_screencast_unstable_v1 does not seem to be available

This suggests your plasma might not be properly installed?
Comment 7 Samuel Reddy 2022-01-15 05:09:49 UTC
Logging output for xdp-kde:

xdp-kde: Desktop portal registered successfully
xdp-kde-wayland-integration: Registry initialized
xdp-kde-wayland-integration: Adding output:
xdp-kde-wayland-integration:     manufacturer:  "Najing CEC Panda FPD Technology CO. ltd"
xdp-kde-wayland-integration:     model:  "eDP-1-unknown"
xdp-kde-wayland-integration:     resolution:  QSize(1920, 1080)
xdp-kde-background: GetAppState called: no parameters
xdp-kde-settings: ReadAll called with parameters:
xdp-kde-settings:     groups:  ("org.kde.kdeglobals.*")
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "menuFont"
xdp-kde-settings: Key  "menuFont"  doesn't exist
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "font"
xdp-kde-settings: Key  "font"  doesn't exist
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.WM"
xdp-kde-settings:     key:  "activeFont"
xdp-kde-settings: Key  "activeFont"  doesn't exist
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "toolBarFont"
xdp-kde-settings: Key  "toolBarFont"  doesn't exist
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "smallestReadableFont"
xdp-kde-settings: Key  "smallestReadableFont"  doesn't exist
xdp-kde-settings: Read called with parameters:
xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdp-kde-settings:     key:  "fixed"
xdp-kde-settings: Key  "fixed"  doesn't exist
xdp-kde-screencast: CreateSession called with parameters:
xdp-kde-screencast:     handle:  "/org/freedesktop/portal/desktop/request/1_108/obs1"
xdp-kde-screencast:     session_handle:  "/org/freedesktop/portal/desktop/session/1_108/obs1"
xdp-kde-screencast:     app_id:  "com.obsproject.Studio"
xdp-kde-screencast:     options:  QMap()
xdp-kde-screencast: SelectSource called with parameters:
xdp-kde-screencast:     handle:  "/org/freedesktop/portal/desktop/request/1_108/obs2"
xdp-kde-screencast:     session_handle:  "/org/freedesktop/portal/desktop/session/1_108/obs1"
xdp-kde-screencast:     app_id:  "com.obsproject.Studio"
xdp-kde-screencast:     options:  QMap(("cursor_mode", QVariant(uint, 4))("multiple", QVariant(bool, false))("types", QVariant(uint, 1)))
xdp-kde-screencast: Start called with parameters:
xdp-kde-screencast:     handle:  "/org/freedesktop/portal/desktop/request/1_108/obs3"
xdp-kde-screencast:     session_handle:  "/org/freedesktop/portal/desktop/session/1_108/obs1"
xdp-kde-screencast:     app_id:  "com.obsproject.Studio"
xdp-kde-screencast:     parent_window:  ""
xdp-kde-screencast:     options:  QMap()
QQmlApplicationEngine failed to load component
qrc:/ScreenChooserDialog.qml:13:1: Type PWD.SystemDialog unavailable
file:///usr/lib/qt/qml/org/kde/plasma/workspace/dialogs/SystemDialog.qml:137:9: DesktopSystemDialog is not a type
QObject::connect: Cannot connect (nullptr)::accept() to ScreenChooserDialog::accept()
QObject::connect: Cannot connect (nullptr)::reject() to ScreenChooserDialog::reject()
QObject::connect: Cannot connect (nullptr)::clearSelection() to ScreenChooserDialog::clearSelection()
Failed to load dialog, cannot exec
xdp-kde-session: "org.freedesktop.impl.portal.Session"
xdp-kde-session: "Close"
xdp-kde-session: "/org/freedesktop/portal/desktop/session/1_108/obs1"
Comment 8 Nicolas Fella 2022-01-15 13:05:02 UTC
> QQmlApplicationEngine failed to load component
> qrc:/ScreenChooserDialog.qml:13:1: Type PWD.SystemDialog unavailable
> file:///usr/lib/qt/qml/org/kde/plasma/workspace/dialogs/SystemDialog.qml:137:9: DesktopSystemDialog is not a type

This looks like plasma-workspace is incorrectly installed
Comment 9 Nicolas Fella 2022-01-15 13:07:50 UTC
Or something else? 

@Aleix where is DesktopSystemDialog supposed to come from?
Comment 10 Matej Mrenica 2022-01-15 19:48:52 UTC
Is this the same issue: https://github.com/obsproject/obs-studio/issues/5794 ?
I have this problem too.
Comment 11 Matej Mrenica 2022-01-15 20:05:42 UTC
(In reply to Matej Mrenica from comment #10)
> Is this the same issue: https://github.com/obsproject/obs-studio/issues/5794
> ?
> I have this problem too.

It doesn't seem to be the same issue as this. Also on a second thought, I don't have this issue but rather the one described in the link.
My log: https://pastebin.com/YusP2Y9U
Comment 12 Matej Mrenica 2022-01-15 20:11:30 UTC
Either way downgrading to 5.23.5 fixes this issue.
Comment 13 Nate Graham 2022-01-15 20:17:17 UTC
Did the change to use SystemDialog make it into 5.24, but the SystemDialog components themselves are still git master only?
Comment 14 Marco Rebhan 2022-01-15 23:17:44 UTC
Also happens for me, all Plasma packages on my system were built from latest git commits a couple hours ago.

Relevant commit: https://invent.kde.org/plasma/plasma-workspace/-/commit/5291c774651fe371f67bf1ee36197d8e6acd47e5

Reverting this makes the mobile dialog pop up which crashes the portal on close (see MR description https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1281) so I also hardcoded this https://invent.kde.org/plasma/plasma-workspace/-/commit/5291c774651fe371f67bf1ee36197d8e6acd47e5#251d9c6f37e9019adff30d154a57fee445dfd70f_113_114 to "DesktopSystemDialog.qml" and now it works again.
Comment 15 Patrick Silva 2022-01-15 23:36:00 UTC
yes. As I said in comment 3, the problem also occurs on neon unstable.
Comment 16 Bug Janitor Service 2022-01-16 23:22:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1368
Comment 17 Pawel 2022-01-17 10:39:18 UTC
(In reply to Bug Janitor Service from comment #16)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1368

I can confirm this patch resolves the issue for me on Arch Linux
Comment 18 Fabian Vogt 2022-01-17 11:45:12 UTC
Git commit cdae8fef8948827350d3a1ffb917425fe4e93773 by Fabian Vogt, on behalf of Nicolas Fella.
Committed on 17/01/2022 at 11:31.
Pushed by fvogt into branch 'master'.

[systemdialogs] Remove leftover and broken components

These are presumably leftover from previous refactoring

Since those types don't exist they break things

M  +0    -11   components/dialogs/SystemDialog.qml

https://invent.kde.org/plasma/plasma-workspace/commit/cdae8fef8948827350d3a1ffb917425fe4e93773
Comment 19 Fabian Vogt 2022-01-17 11:46:36 UTC
Git commit a85f21557e71014e0ca3e7212f9d9dbd5b62ce3d by Fabian Vogt, on behalf of Nicolas Fella.
Committed on 17/01/2022 at 11:46.
Pushed by fvogt into branch 'Plasma/5.24'.

[systemdialogs] Remove leftover and broken components

These are presumably leftover from previous refactoring

Since those types don't exist they break things


(cherry picked from commit cdae8fef8948827350d3a1ffb917425fe4e93773)

M  +0    -11   components/dialogs/SystemDialog.qml

https://invent.kde.org/plasma/plasma-workspace/commit/a85f21557e71014e0ca3e7212f9d9dbd5b62ce3d
Comment 20 Nate Graham 2022-01-20 22:46:50 UTC
*** Bug 448781 has been marked as a duplicate of this bug. ***
Comment 21 Nicolas Fella 2022-01-23 22:59:14 UTC
*** Bug 449035 has been marked as a duplicate of this bug. ***
Comment 22 Allexus J 2022-01-25 13:29:21 UTC
(In reply to Matej Mrenica from comment #12)
> Either way downgrading to 5.23.5 fixes this issue.

If I downgrade from plasma beta to plasma stable (archlinux repo), so I came back to kde portal 5.23.5-1, Chrome at least shows the kde screen sharing permissions window, but after I click on share, chrome crashes. You can find journalctl logs here of core dump here: https://bugs.kde.org/attachment.cgi?id=145910

Firefox still does not even show the permission window, just does nothing. 
OBS WORKS though.