SUMMARY Screen sharing on Wayland doesn't work out of the box, since the WebRTCPipeWireCapturer chromium options is disabled by default. STEPS TO REPRODUCE 1. Go to https://mozilla.github.io/webrtc-landing/gum_test.html 2. Click "Screen capture" and accept permissions OBSERVED RESULT Black screen EXPECTED RESULT Screen is shared Setting the env variable QTWEBENGINE_CHROMIUM_FLAGS="--enable-features=WebRTCPipeWireCapturer" makes it work. Note that QtWebengine crashes when compiled with pipewire 0.2 if the compositor is running a recent pipewire version, so in order to test this a patched QtWebengine is probably needed (such as the one shipped by Arch Linux or Flathub)
Unfortunately, I don't use neither Wayland nor pipewire, so I couldn't test your suggestion. I tried running Konqueror in Wayland and, as you say, the test page doesn't work. However, the same happens when setting the environment variable you suggested. Maybe this is related to what you say about a patched QtWebEngine. I'm on Gentoo, and when I tried to enable pipewire, it didn't ask to recompile it. If that's the case, I can try recompiling it myself, but since I can't see in my package manager an option to enable pipewire support in it, I doubt it'll change anything. Since compiling QtWebEngine takes quite a while, I'm not sure when I'll have time to do it. Do you have any more information on what patches ArchLinux apply to their QtWebEngine?
It looks like gentoo doesn't enable pipewire screen share at all [1]. It needs the qmake flag -webengine-webrtc-pipewire. Additionally, as I mentioned, it needs a patch [2] to use pipewire 0.3, otherwise it will simply crash. For reference, this is the relevant code in Qutebrowser, where this works properly [3]. [1] https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-qt/qtwebengine/qtwebengine-5.15.2_p20211216.ebuild [2] https://github.com/archlinux/svntogit-packages/blob/packages/qt5-webengine/trunk/qt5-webengine-pipewire-0.3.patch [3] https://github.com/qutebrowser/qutebrowser/blob/4435ef928796fa744be5452924a103bb2e58ee8e/qutebrowser/config/qtargs.py#L128
Created attachment 147318 [details] Patch to enable WebRTCPipeWireCapturer flag
I tried applying the patch you provided to QtWebEngine, but nothing changed. Is there any chance you can compile Konqueror yourself applying the attached patch and test if it works?
(In reply to Stefano Crocco from comment #4) > I tried applying the patch you provided to QtWebEngine, but nothing changed. > Is there any chance you can compile Konqueror yourself applying the attached > patch and test if it works? Everything works fine with the patch, thanks
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/113
Git commit 0f360fad77e1dd88ab141e18d0819cf99b417928 by David Faure, on behalf of Stefano Crocco. Committed on 19/03/2022 at 23:07. Pushed by dfaure into branch 'master'. Enable WebRTCPipeWireCapturer feature for QtWebEngine This is needed to have screen capture on Wayland using pipewire. It's optional because it crashes with pipewire-3 unless using a patched version of QtWebEngine M +7 -0 CMakeLists.txt M +4 -0 src/konqapplication.cpp https://invent.kde.org/network/konqueror/commit/0f360fad77e1dd88ab141e18d0819cf99b417928
Git commit 93a1b098cad3e83afeba467d8528c19edfe000b5 by Stefano Crocco. Committed on 20/03/2022 at 21:18. Pushed by stefanocrocco into branch 'release/22.04'. Enable WebRTCPipeWireCapturer feature for QtWebEngine This is needed to have screen capture on Wayland using pipewire. It's optional because it crashes with pipewire-3 unless using a patched version of QtWebEngine (cherry picked from commit 0f360fad77e1dd88ab141e18d0819cf99b417928) M +7 -0 CMakeLists.txt M +4 -0 src/konqapplication.cpp https://invent.kde.org/network/konqueror/commit/93a1b098cad3e83afeba467d8528c19edfe000b5