TL;DR: make sure you have pipewire and xdg-desktop-portal installed, look up how to enable pipewire for your browser. It might help.

Well, this blog post barely scratches the surface.

The Linux userspace display stack is currently undergoing a big overhaul, following the changes that happened in the kernel a few years ago (DRI3, KMS, atomic modesetting, etc).

All of this made Wayland possible. That, plus the fact that apps rasterize their surfaces themselves nowadays (GPU-accelerated trough OpenGL/Vulkan).

So, here comes Wayland with a new security model: you can't spy on other windows, so you cannot hack together a desktop sharing solution. A proper, cross-desktop solution is actually being worked on: pipewire[1].

Pipewire aims to replace both pulseaudio and jack for audio, and bring video in as well. So you will be able to direct which video feed goes where, use the same webcam for multiple applications, and have applications take a video feed, transform it, and plug it elsewhere. You can see where this is fitting with desktop sharing: one feed per window, one feed per screen, one feed for the whole desktop, plus variants. Want to overlay a webcam? No problem. Everything is backed by Gstreamer for realtime hardware-accelerated video encoding/decoding.

And the icing on the cake: Flatpak spearheaded the development of "portals"[2]: cross-desktop interfaces for individual programs to ask the user when accessing restricted resources (like a microphone, or a folder on your computer).

So, what's needed here is:

* Finish up pipewire and have it shipped on most distributions (should be installed in fedora 31, optional for sound in 32, default for sound in 33)

* Have compositors talk to pipewire [3]

* Have browsers and other software talk to pipewire [4]

* ???

* Profit

Good progress is being made on these points, except maybe the last? I expect support to start working out-of-the-box in some distros/browser/compositor combinations in 2020. Actually, support seems further along than I thought it was. But it seems that wlroots-based compositor haven't yet decided to support the xdg screensharing portal, and rely instead on a custom wayland extension. I wouldn't be surprised if such a portal is implemented for those.

The main issue here is everyone waiting on everyone else before enabling/implementing it. But it looks like we're 80% there, and it just needs to be enabled in some cases (and pipewire installed). Then it will trickle down to most distros and electrons apps.

However, I don't think legacy X apps will be able to continue sharing the desktop (they can still be shared by wayland capture programs, or capture the desktop if they implement the new interface). I guess pipewire might be able to create a virtual webcam for these, though.

Valve might be working on their own stack with their "Gamescope" wayland compositor[5], for their streaming solution.

And in the end, this should work much better, with hardware encoding, actual security, zero copy, etc. Hopefully there won't be a "next big thing" that breaks everything in just a few years.

[1] https://pipewire.org/

[1] https://wiki.archlinux.org/index.php/PipeWire

[2] https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm...

[2] https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm...

[3] http://jgrulich.cz/2018/03/06/screen-sharing-in-plasma-wayla...

[3] https://jgrulich.cz/2018/07/04/how-to-enable-and-use-screen-...

[3] https://wiki.gnome.org/Projects/Mutter/RemoteDesktop

[3] https://www.reddit.com/r/linux/comments/8le7rm/first_steps_f...

[3] https://github.com/emersion/xdg-desktop-portal-wlr/issues/1

[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1496359 (looks disabled by default at compile time)

[4] https://bugs.chromium.org/p/chromium/issues/detail?id=682122 (pipewire disabled in chrome://flags until v81 due to waiting on https://github.com/flatpak/xdg-desktop-portal-gtk/issues/204 "dialog hell" it seems)

[4] zoom currently uses a gnome-specific screenshot API as a workaround: https://www.reddit.com/r/swaywm/comments/dr8yld/zoom_screens...

[5] https://www.gamingonlinux.com/articles/valve-give-a-little-m...