Skip to content

Support Pipewire RemoteDesktop API for capturing on Wayland#1566

Open
maksimkurb wants to merge 1 commit into
awawa-dev:masterfrom
maksimkurb:feature/pipewire-remote-desktop-api
Open

Support Pipewire RemoteDesktop API for capturing on Wayland#1566
maksimkurb wants to merge 1 commit into
awawa-dev:masterfrom
maksimkurb:feature/pipewire-remote-desktop-api

Conversation

@maksimkurb

Copy link
Copy Markdown

Summary

This adds optional support for org.freedesktop.portal.RemoteDesktop as an alternative PipeWire portal path for Wayland screen capture.

The main motivation is KDE behavior. With the existing ScreenCast portal flow, KDE treats HyperHDR capture as active screen sharing and can automatically enable “Do not disturb” mode while HyperHDR is running. I do not want to disable this KDE privacy feature globally, because it is useful when I actually share my screen in Zoom, Google Meet, or similar apps. HyperHDR is a background ambient-light capture service, so it should not force the desktop into the same notification behavior as an interactive screen-sharing session.

The RemoteDesktop portal path avoids that KDE “screen sharing” DnD behavior for this use case, while still going through the desktop portal permission system.

There is also a secondary benefit for unattended Wayland startup and resume. With KDE and flatpak-kcm, users can explicitly remember HyperHDR’s desktop access permanently and this would prevent "Select Screen" dialogs after sleep.

  • Adds a generated RemoteDesktopProxy.
  • Detects org.freedesktop.portal.RemoteDesktop support by checking protocol version >= 2.
  • Adds a new Pipewire All Screens (RemoteDesktop API) capture option when available.
  • Starts capture through the RemoteDesktop portal for that mode.
  • Keeps the existing ScreenCast API path available as a separate option.

This should prevent HyperHDR from triggering KDE Do Not Disturb due to “Screen Sharing”, while also improving unattended Wayland capture behavior after startup and some sleep/resume cases.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Place Before After
Software Screen Capture settings изображение Screenshot_20260702_113434
KDE behavior DnD mode automatically enabled Screenshot_20260702_113528 Screenshot_20260702_113537 No DnD mode enabled изображение
Screen Recording Permission prompt (for ScreenCast API) Screenshot_20260702_120329 (for RemoteDesktop API) Screenshot_20260702_120252

In KDE, users can install the flatpak-kcm package and explicitly allow HyperHDR to capture the screen without asking for permission each time:

изображение

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

Other information:

  • I haven't tested this on Gnome yet, I can install this DE and test it if needed.
  • Old Pipewire system dialog selection entry was renamed to Pipewire system dialog selection (ScreenCast API), I can revert this change if it is undesirable
  • I haven't succeeded in recording only one screen via RemoteDesktop API, seems it always streams all screens. Also there were no APIs to enumerate monitors (or I haven't found them in xdg desktop portal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant