https://bugs.kde.org/show_bug.cgi?id=464147

Aleix Pol <aleix...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REPORTED                    |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/xdg-desktop-portal-kde/c
                   |                            |ommit/6a83f327e9111703fe63a
                   |                            |69bb6a2ff987278bbfc

--- Comment #10 from Aleix Pol <aleix...@kde.org> ---
Git commit 6a83f327e9111703fe63a69bb6a2ff987278bbfc by Aleix Pol Gonzalez, on
behalf of Dominique Hummel.
Committed on 13/02/2023 at 02:03.
Pushed by apol into branch 'master'.

Add the ability to stream a rectangular region

## Background

On a large panel, current screen casting options could be found lackluster, for
different reasons. Streaming the entire screen is usually undesirable, because:

- it will look too small on other people's screens (some apps allow zooming,
but many don't)
- bandwidth is being unnecessarily consumed
- large images often incur greater amounts of compression artifacts
- usually (but not always), there will be irrelevant sections of the screen
which will nonetheless be streamed

As a workaround, it is possible to stream a single window. However, this comes
with its own problems:

- context menus (incl. global menu) are not visible to the viewers
- popup windows (e.g. Krita's layer filters) are not visible to the viewers
- switching between windows (e.g. code editor and live preview) requires ending
and restarting the stream

Finally, there are virtual outputs, but since they only exist in virtual space,
this means the only way to observe their contents is through the app that is
streaming them. Often times, this comes with significant latency and/or
reduction in FPS, making it difficult for the streamer to interact with the
streamed content.

## Solution

This MR adds the ability to stream a rectangular subregion of the user's
screen. Upon selecting the output "Rectangular Region" in portal, the user will
be prompted to click & drag a rectangular region, which will then subsequently
be streamed. The user has the option to reset the region by right-clicking
during the drag process, as well as cancelling altogether by pressing Escape,
upon which the portal dialog will be reopened.

This makes it possible to do the following, without streaming the entire
screen:

- stream multiple windows at once
- stream context menus (incl. global menu)
- switch between windows without having to restart the stream

## Preview

![rec1](/uploads/084095a9d52a4ec44c9b0c3c8562953e/rec1.mp4)

## ToDo's

- [x] Wait for https://invent.kde.org/plasma/kwin/-/merge_requests/3561 to be
merged (there's currently a KWin bug that incorrectly offsets the y-coordinate
of the streamed region)
- [x] Test with a multi-monitor setup
- [x] ~~Force the regular fade in/-out animation for the overlay~~ not possible
(yet)

## Known Issues

- When changing the workspace proportions (through adding/removing a new
monitor or virtual output) towards negative X or Y (= left or upwards), the
streamed region is not correctly preserved, but is instead shifted towards the
added space / away from the removed space.

## Relevant Tickets

M  +3    -0    CMakeLists.txt
M  +2    -0    src/CMakeLists.txt
M  +6    -0    src/outputsmodel.cpp
M  +1    -0    src/outputsmodel.h
M  +1    -1    src/quickdialog.h
A  +9    -0    src/region-select/FloatingBackground.qml  *
A  +27   -0    src/region-select/FloatingTextBox.qml  *
A  +216  -0    src/region-select/RegionSelectOverlay.qml  *
A  +248  -0    src/region-select/SelectionEditor.cpp  *
A  +52   -0    src/region-select/SelectionEditor.h  *
M  +3    -0    src/resources.qrc
M  +5    -0    src/screencast.cpp
M  +39   -1    src/screenchooserdialog.cpp
M  +10   -0    src/screenchooserdialog.h
M  +15   -0    src/waylandintegration.cpp
M  +2    -0    src/waylandintegration.h
M  +1    -0    src/waylandintegration_p.h

The files marked with a * at the end have a non valid license. Please read:
https://community.kde.org/Policies/Licensing_Policy and use the headers which
are listed at that page.


https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/6a83f327e9111703fe63a69bb6a2ff987278bbfc

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to