Draft: Screen chooser dialog on RemoteDesktop with screen sharing enabled
While trying to share my screen during a call with the latest version of the Zoom software I was presented with a dialog asking to authorize Zoom to remotely control screens and input devices. When authorizing Zoom, the aggregate of all my monitor was being shared but I was unable to share a specific screen or window. I was able to do so in previous a version of the software. After investigating what was happening I noticed they switched from using only a ScreenCast session to a RemoteDesktop session with screen sharing enabled. I could successfully reproduce the problem using some example code for the RemoteDesktop session with the ASHPD library.
The changes in this merge request tries to add the window/screen selection dialog after the remote desktop dialog. This is done by copying the code already written in the ScreenCastPortal
class. This was done to have the feature working as early as possible and do a better integration later.
Some area of improvement could be to share the code between both classes somewhere (to avoid needing to have coherent code in multiple places), having a single dialog instead of chaining the two (similar to how Gnome is handling it where it's possible to disable the remote control but still allow the screen sharing).
I'm also unsure how to handle the persistence question since both dialogs are asking for the same thing. It also doesn't seem possible to hide the checkbox on the screen chooser dialog at this moment.
I have tested that this code works on a newly created Virtual Machine, Zoom is using the window I decided to share. However, I'm encountering a bug that freezes Zoom once the session is stopped (For example when the session is stopped by Zoom, by the stop button in KDE or by closing the shared window).
NOTE: It's my first time contributing to a KDE/QT project so I'm unfamiliar with the good practices and what should be kept in mind while writing code.
Reference: