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

            Bug ID: 528594
           Summary: Window screencasts include server-side decorations; no
                    option to capture the client contents only
    Classification: Plasma
           Product: kwin
      Version First 6.8.2
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: screencasting
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Window screencast streams always contain the server-side window decoration
(titlebar and border), and the consumer has no way to request the window
contents only. Screenshots already support this: org.kde.KWin.ScreenShot2
CaptureWindow accepts "include-decoration" (default false) and
"include-shadow".

STEPS TO REPRODUCE
1. On Plasma Wayland, start a window screencast through
   org.freedesktop.portal.ScreenCast (e.g. OBS "Window Capture (PipeWire)", or
   "Share window" in a browser).
2. Select a window with server-side decorations (Dolphin, Konsole, System
   Settings, ...).
3. Look at the resulting stream.

OBSERVED RESULT
The stream contains the KWin titlebar and window border, and its size includes
the decoration. The consumer cannot crop it reliably: the decoration size
depends on the decoration theme and scale factor, and the corners are rounded.

EXPECTED RESULT
It should be possible to request a window stream with the client contents only,
like CaptureWindow can exclude decorations and shadows. This could be an option
in the portal (SelectSources), propagated through zkde_screencast_unstable_v1
to
KWin, and/or a KWin-side setting or window rule. The current behavior can stay
the default.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.8.2
KDE Frameworks Version: 6.31.0
Qt Version: 6.12.0

ADDITIONAL INFORMATION
This is intentional behavior since Plasma 6.5: commit 418b44bc
("plugins/screencast: Include decoration in window screencasts",
https://invent.kde.org/plasma/kwin/-/merge_requests/7853) changed
WindowScreenCastSource::boundingRect() from clientGeometry() to frameGeometry()
because undecorated windows "look a bit weird in recordings". The opposite use
case is now impossible to express.

Interfaces checked against master (2026-11):
- org.freedesktop.portal.ScreenCast.SelectSources: only cursor_mode,
  restore_token, persist_mode.
- zkde_screencast_unstable_v1 (v6): stream_window(window_uuid, pointer).
- org.kde.KWin.ScreenShot2 CaptureWindow: include-decoration (default false),
  include-shadow (default true).

Implementation sketch: extend stream_window with flags for
include-decoration/include-shadow; in WindowScreenCastSource use
clientGeometry() and filter decorationItem()/shadowItem() out of the painted
item tree, keeping the current behavior as the default.

For client-side-decorated windows (Firefox, Chromium, Electron) the titlebar is
part of the client contents and would still be streamed; that is expected.

Related: https://gitlab.gnome.org/GNOME/mutter/-/work_items/2865
Related KDE report about Spectacle's recording UI:
https://bugs.kde.org/show_bug.cgi?id=511463

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

Reply via email to