News for hackers. Stuff that matters.
Re:Ask HN: Why does Zoom Desktop examine all processes and a... by woodruffw on Tuesday August 17, 2021 @05:42PM (#28215206)
Based on OP's snippet they're probably doing this on Linux. Assuming the presence of X11 and an EWMH-compatible window manager, they could query X11 directly and ask the root window for its `_NET_CLIENT_LIST` attribute. That, in turn, would list every "semantic" (i.e., non-decorative) window currently open on the current display.

But that doesn't work for non-X11 or if the WM is non-EWMH compliant. Presumably Wayland has a similar API, and non-EWMH is probably a minuscule group that considers this a desirable feature.

Re:Ask HN: Why does Zoom Desktop examine all processes and a... by sp1rit on Tuesday August 17, 2021 @06:47PM (#28215669)
One of the selling points of Wayland is, that they have no such API. An Application is supposed to be unable to access windows (and their corresponding keyboard/mouse input).

One of the downsides this has is the described issue of "screensharing beeing impossible on wayland". This is solved by the XDG Desktop Portal, which provides a unified dbus interface across the different compositor implementations for requesting a pipewire file descriptor (which can be used with gstreamer to get a live video stream of the deskop, in a way far superior to x11 framegrab). However the implementation differs for each compositor, GNOME for example asks you if you what to share the whole screen or just a specific application but wlroots (swaywm, wayfire, etc.) AFAIK automatically accepts and shares the whole screen. I don't know what KDE Plasma does.

Re:Ask HN: Why does Zoom Desktop examine all processes and a... by dathinab on Tuesday August 17, 2021 @09:33PM (#28216803)
I initially miss read you post, you formulations can be a bit misleading.

E.g. "Wayland is, that they have no such API.", it has screen sharing APIs but they are different and require you do go through other programs like XDG Desktop Portal and Pipewire to allow the user to control such access. Similar this also means Wayland supports screen sharing just in different ways.

Anyway the important parts are:

- the implementation might differ, but the API doesn't (or at least not by a relevant degree)

- wayland requires you to go through specific APIs for screen sharing, scanning processes has little to do with screen sharing on either wayland or X.

Re:Ask HN: Why does Zoom Desktop examine all processes and a... by account42 on Thursday August 19, 2021 @05:01AM (#28231756)
> which can be used with gstreamer to get a live video stream of the deskop, in a way far superior to x11 framegrab

I don't think I'd agree that having to go through dbus and pipewire just to get the contents of the screen or a window is far superior to requesting that data from the display server. It certainly adds a lot of complexity with subpar documentation spread across multiple projects. Does this provide you a compressed stream or can you get the raw pixels that are displayed?

Re:Ask HN: Why does Zoom Desktop examine all processes and a... by dathinab on Tuesday August 17, 2021 @09:12PM (#28216667)
> Presumably Wayland ...

Yes there is a wayland extension for screen sharing and also support for sharing just one application.

It provides screen sharing on KDE, Gnome and most wlroots based WMs.

Through wlroots doesn't yet (or maybe does by now) support sharing a specific window I think, but this mean it doesn't support sharing a specific window and knowing which process belongs to a window doesn't really help you there either...