emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
591 stars 56 forks source link

Chooser menu presented 2 times when screen sharing #197

Closed paolomainardi closed 2 years ago

paolomainardi commented 2 years ago

Testing here: https://mozilla.github.io/webrtc-landing/gum_test.html (it happens on any webrtc based app).

Just a simple standard xdg-desktop-portal-wlr conf:

> cat .config/xdg-desktop-portal-wlr/sway
[screencast]
chooser_type=dmenu
chooser_cmd=wofi --show=dmenu

This is the sequence i see all the times:

1) image

2) image

3) image

4) image

As you can see point 1 and 3 both run the chooser_cmd the let me select the screen, which is already selected.

Am i seeing something wrong here or it is the current implementation to behave like this ?

Thanks!

columbarius commented 2 years ago

Chromium insists on using it's own chooser. It can't transfer the already opened stream from it's chooser to the actual screencast, so it queries two times (once for its chooser and once for the screencast). If you are funny you can select another output the second time. This can be solved by #170 if chromium also implements (has implemented, don't know the current state) the client side of the mechanism.