Bug 456957

Summary: Allow to choose active screen as a source in screen share dialog
Product: [Plasma] kwin Reporter: Andrew Shark <ashark>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: aleixpol, jgrulich, kde, nate
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andrew Shark 2022-07-20 20:21:17 UTC
In Simple Screen Recorder (x11 screencast application) there is a nice feature that allows you to choose a specific source, that is a current screen with mouse cursor. When you move mouse to another screen, the recording will switch to that screen.  It is called "follow mouse" in the screenshot https://www.maartenbaert.be/simplescreenrecorder/. This feature is helpful when you want to record some tutorial on video, while operating on your several monitors. I wish I could use such thing in KDE on Wayland.

Currently the screen share dialog has options of special sources "Full Workspace", "New Virtual Output" and a list of all your physical monitors. In KDE the screen with mouse is called "Active Screen". I want to see a special option "Active Screen" in that dialog.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Graphics Platform: Wayland
Comment 1 Aleix Pol 2022-07-20 22:32:50 UTC
How would that work for screens with a different resolution? the video size cannot change...
Comment 2 Andrew Shark 2022-07-20 22:48:34 UTC
I think it should behave as follows: choose the biggest screen resolution and output at that resolution. If active screen changes to smaller than biggest, stretch it and if aspect ratio is not the same then keep black side areas.

If I remember correctly simple screen recorder starts recording at resolution of screen at which recording was started and then scales an image from other screen if it's resolution is not the same. I however did not tested how it behaves if the aspect ratio is different on another screen. I can do any test if you ask   and is possible with my hardware.
Comment 3 David Edmundson 2022-07-21 09:32:12 UTC
I think this is out of scope for kwin for the reasons given in #1

The client is given the mouse position so it can request to record both screens and then perform any switching client side.
Comment 4 Andrew Shark 2022-07-21 10:33:51 UTC
I understand I can make another scenes in obs with another screens and switch scenes by detecting active screen changing (by the way I do not currently know how to get this work in OBS, probably need write a plugin that will constantly check current active screen by doing dbus request).
But that way I need to manually keep an eye if scene corresponds to the monitor number returned by dbus request. And also I will have to reconfigure setup each time I add or remove monitors or change their resolution.

And also I need such thing not only in OBS, but also in browser and telegram when speaking to somebody. And there is no such "scenes" switch for them as in OBS.

And I really think that having a special entry to stream active screen would be useful there in portal menu. If not in kwin, may it be probably done via some plug-in for portal that will do this map job internally and be presented as such entry there?
Comment 5 Andrew Shark 2023-05-19 06:58:04 UTC
Can you please reconsider this? I think this is absolutely valid.
Also, info on how to get active screen: https://stackoverflow.com/questions/72681309/how-can-i-get-current-active-screen-a-screen-with-mouse-in-kde-wayland
Comment 6 David Edmundson 2023-05-19 07:29:53 UTC
No new information has been presented since the comment in #3