Bug 421206 - okular presentation mode does not allow for WebRTC screensharing in Firefox/Chromium on X11
Summary: okular presentation mode does not allow for WebRTC screensharing in Firefox/C...
Status: REOPENED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-08 22:52 UTC by Robert Riemann
Modified: 2023-11-22 10:47 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Riemann 2020-05-08 22:52:00 UTC
Dear Okular community,

I am not sure where to look for the problem. So I start here. Please direct me towards the root of the issue if you know better.

Problem Description:

1. open any PDF with okular (on Linux)
2. switch to full screen.
3. notice that a 2nd window is opened which shows no control elements, but just the PDF
4. open Chromium/Firefox, navigate to https://mozilla.github.io/webrtc-landing/gum_test.html and click Screen Capture to simulate e.g. sharing slides during a video conference with tools such as Meet.Jitsi or bigBluebutton etc.
5. Both tested browsers present a list of application windows that can be shared, that does not contain the full screen window with the slides, but only the main window of Okular.

Okular’s full screen window cannot be used currently to present full screen slides in WebRTC video conferences. The only option is to share the entire screen and have the okular window full screen. Disadvantage: you cannot see the chat or other participants.
Comment 1 Laura David Hurka 2020-05-09 15:04:38 UTC
This sounds unfortunate.

> 3. notice that a 2nd window is opened which shows no control elements, but just the PDF

Seems like you mean presentation mode, not fullscreen mode. Fullscreen mode has all control elements, although some are hidden. What is your Okular version? Newer versions have both options in the View menu, older menus have one in the View menu and the other in the Settings menu.

Usually the presentation widget appears in the task bar. Do you have two Okular entries in the task bar when you enable presentation mode?
Comment 2 Robert Riemann 2020-05-10 10:11:12 UTC
I run Okular Version 1.10.0.

The view options has two actions "Full Screen Mode" and "Presentation" and indeed, I discuss here the presentation mode.

When I enable presentation mode, I have two Okular entries in the taskbar. This is why I assumed that I could share this secondary application window in Firefox/Chromium. Though that's not possible currently.
Comment 3 Robert Riemann 2020-05-12 16:43:20 UTC
I cross-posted this issue to the Firefox bugzilla:

https://bugzilla.mozilla.org/show_bug.cgi?id=1637327
Comment 4 Laura David Hurka 2020-08-03 15:10:07 UTC
I got an idea: On some task managers you can right-click the second Okular entry, and go to More Actions -> [x] Fullscreen. If you uncheck Fullscreen, does WebRTC work then?
Comment 5 Imre 2021-05-11 14:06:43 UTC
Hi!

I'm (still) having the same issue: going into presentation mode causes the second window (the one that's in presentation mode) to not be seen by web browsers when sharing my screen (tested with Firefox 88.0.1 and Edge 92.0.878.0 on Manjaro Linux KDE). I'm using Okular 21.04.0.

For those looking for a temporal workaround, you can set up a scene in OBS Studio (since OBS can see that window), right click the preview and open a projector window on one of your screens. That window can then be shared in WebRTC calls as opposed to the presentation window of Okular. Naturally this wastes resources and bloats the screen with multiple windows (two more from OBS) including one that looks the same as the presentation window, but at least it works.

Strangely enough the main window of Okular can be shared even when it's in Full Screen Mode (CTRL+Shift+F).

I've tried David Hurka's suggestion but the task manager does not have the "Full screen" option checked on Okular's presentation window. Regardless of whether I check that box, the window is still not seen by browsers.
Comment 6 postix 2022-04-14 12:42:06 UTC
Works for me on

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

using Firefox 99.0, Okular 21.12.3.

Do you still experience it?
Comment 7 physkets 2022-04-15 16:20:53 UTC
It now works for me was well.
Comment 8 Kishore Gopalakrishnan 2022-04-16 14:05:11 UTC
Works for me as well on Wayland (where Firefox seems to use xdg-desktop-portal to ask the user to choose a screen). 

On X11, Firefox uses some kind of in-browser menu that shows a list of windows, and the Okular presentation window is still missing from that list. I couldn't figure out how to force Firefox to open the xdg-desktop-portal screen chooser on X11 as well (the GTK_USE_PORTAL enivronment variable doesn't seem to affect this).

Operating System: Arch Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.15.34-1-lts (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 21.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics
Comment 9 Laura David Hurka 2022-04-16 18:37:05 UTC
In the meantime I refactored the PresentationWidget code related to screen selection and fullscreen. Okular 21.12 and newer use the new code. But I can’t tell what part of it could have caused this bug to be fixed.
Comment 10 postix 2022-07-25 13:42:21 UTC
Robert, can you please confirm that it's fixed for your too using some recent Okular (21.12+) version?
Comment 11 Kishore Gopalakrishnan 2022-07-31 07:23:38 UTC
(In reply to postix from comment #10)
> Robert, can you please confirm that it's fixed for your too using some
> recent Okular (21.12+) version?

I don't think anyone has found that it works on X11. On X11, Firefox uses some custom code to detect the windows that can be shared. It is unclear if the bug is in the code Firefox uses or in Okular (but https://bugzilla.mozilla.org/show_bug.cgi?id=1637327#c5 says it also happens with a QML application, so it may indeed be a Firefox bug).

On wayland, Firefox uses xdg-desktop-portal, and so the windows are correctly shown.

I can still reproduce it on X11 with:
okular 22.07.80
Operating System: Arch Linux
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.18.15-arch1-1 (64-bit)
Graphics Platform: X11
Comment 12 Kishore Gopalakrishnan 2022-07-31 07:31:33 UTC
(In reply to Kishore Gopalakrishnan from comment #11)
> (In reply to postix from comment #10)
> > Robert, can you please confirm that it's fixed for your too using some
> > recent Okular (21.12+) version?
> 
> I don't think anyone has found that it works on X11. On X11, Firefox uses
> some custom code to detect the windows that can be shared. It is unclear if
> the bug is in the code Firefox uses or in Okular (but
> https://bugzilla.mozilla.org/show_bug.cgi?id=1637327#c5 says it also happens
> with a QML application, so it may indeed be a Firefox bug).
> 
> On wayland, Firefox uses xdg-desktop-portal, and so the windows are
> correctly shown.
> 
> I can still reproduce it on X11 with:
> okular 22.07.80
> Operating System: Arch Linux
> KDE Plasma Version: 5.25.3
> KDE Frameworks Version: 5.96.0
> Qt Version: 5.15.5
> Kernel Version: 5.18.15-arch1-1 (64-bit)
> Graphics Platform: X11

The code Firefox uses seems to be in third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc (the function GetWindowList) in case anyone wants to take a look. I'm guessing from the name that this is the same code Chromium uses on X11.
Comment 13 Robert Riemann 2023-11-22 09:52:44 UTC
In the meanwhile, opensuse Tumbleweed switched to Wayland. On wayland, Firefox offers to delegate the choice to the OS tool. In that window picker tool (I guess offered by wayland), I can find okular's fullscreen presentation mode window.

So for me, the bug could be closed as resolved – works for me. Any opposition?
Comment 14 postix 2023-11-22 10:42:56 UTC
(In reply to Robert Riemann from comment #13)
> In the meanwhile, opensuse Tumbleweed switched to Wayland. On wayland,
> Firefox offers to delegate the choice to the OS tool. In that window picker
> tool (I guess offered by wayland), I can find okular's fullscreen
> presentation mode window.

Can confirm, works fine under Fedora 39 Wayland now.

> So for me, the bug could be closed as resolved – works for me. Any
> opposition?

Let's closed it as fixed. :)
Comment 15 postix 2023-11-22 10:47:25 UTC
Sorry I was too fast. Just tested it on X11 and it still doesn't work there with Chromium and Firefox -> reopen.
The title of the bug report is also explicitly about X11.