Skip to content

Cast a single window instead of the whole screen (xdg-desktop-portal ScreenCast WINDOW) #62

Description

@IlyaP358

Add an option to cast a single application window instead of a whole monitor, so private things on the rest of the screen (IDE, messengers, notifications) never reach the TV.

Right now FluxCast captures a whole output, so everything on that monitor goes to the TV. Casting one window is the cleanest privacy option on KDE/GNOME Wayland, and the portal already supports it.

The portal ScreenCast interface can hand fluxcast a window source, i just don't request it yet.

  • src/portal_capture.py: SelectSources types is 5 (Monitor|Virtual). Add Window (bit 2) -> 7, ideally behind an opt-in flag so normal casting stays unchanged.
  • src/wfd.py _start_desktop_portal: it currently scales the pipewiresrc straight into the negotiated resolution. A window is an arbitrary size and can resize mid-stream, so it needs compositing onto a black canvas at the negotiated resolution (aspect-preserving letterbox, e.g. videoscale add-borders / videobox) with caps renegotiation on resize.

Separate from the virtual-desktop / headless-output idea (tracked separately), this one is purely portal window capture!!!

Credit: this was raised by users on Habr, yursdan asked about keeping private windows off the TV, and eri pointed at exactly this approach (portal ScreenCast window source + gstreamer compositing onto a black canvas).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions