Bug 452612

Summary: WebRTC in Chromium: Selecting screen / window fails and portal dialog opens a second time, where it then works
Product: [Plasma] xdg-desktop-portal-kde Reporter: postix <postix>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: aleixpol, jgrulich, nate, postix
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.25.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Journalctl log

Description postix 2022-04-14 14:15:15 UTC
Created attachment 148154 [details]
Journalctl log

SUMMARY

Very frequently when trying to share a screen or window in a WebRTC session in Chromium

`$ /usr/bin/chromium --enable-features=WebRTCPipeWireCapturer --ozone-platform=wayland --enable-usermedia-screen-capturing`, 

the first try fails and the screen / window picker dialog opens a second time. This times, most often the selection of a window / screen works.

Testing website: `https://mozilla.github.io/webrtc-landing/gum_test.html`
Click on "Screen capture".

Please see the attached journalctl log, though I'm not certain that the problem can be really identified from it.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220412
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2
Kernel Version: 5.17.1-1-default (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 580 Series
Version 100.0.4896.88 (openSUSE Build) stable (64-bit) (no addons; fresh profile)
Comment 1 postix 2022-04-15 14:50:12 UTC
Side remark: Jan Grulich is currently working on getting rid of the second portal dialog:

> this will allow us to skip the second portal dialog and I already have plan in my head how to do this in WebRTC. This is currently only supported by xdg-desktop-portal-gnome and xdg-desktop-portal-kde lacks this functionality.

[1] https://jgrulich.cz/2022/02/16/webrtc-journey-to-make-wayland-screen-sharing-enabled-by-default/
Comment 2 Aleix Pol 2022-07-26 13:48:38 UTC
This will work alright with chrome 105, support for the stream restoration is already supported by Plasma.