Skip to content

fix(privacy): detect screen captures from xdg-desktop-portal-wlr - #4074

Open
benoitjpnet wants to merge 1 commit into
noctalia-dev:mainfrom
benoitjpnet:fix/privacy-detect-xdpw-screen-capture
Open

fix(privacy): detect screen captures from xdg-desktop-portal-wlr#4074
benoitjpnet wants to merge 1 commit into
noctalia-dev:mainfrom
benoitjpnet:fix/privacy-detect-xdpw-screen-capture

Conversation

@benoitjpnet

Copy link
Copy Markdown

Problem

The privacy widget and OSD never show the screen-capture icon while sharing the screen through xdg-desktop-portal-wlr.

Screen-share detection in src/pipewire/pipewire_service.cpp relies on node-name heuristics (kScreenShareNamePrefixes etc.). xdg-desktop-portal-wlr names its stream nodes xdpw-stream-<random> (verified: media.name = xdpw-stream-heAokj), which matches none of the existing prefixes/fragments:

  • xdph-streaming (Hyprland portal) is checked, but not xdpw-stream (wlr portal)
  • the node has no media.role, so classification falls through to the name heuristics and fails

Repro

  1. niri (or any wlroots compositor) with xdg-desktop-portal-wlr
  2. Share the screen from Chromium (e.g. Jitsi)
  3. PipeWire graph shows a Video/Source node xdpw-stream-* linked to Stream/Input/Video — privacy widget/OSD show nothing

Fix

Add xdpw-stream to kScreenShareNamePrefixes. Mic and camera detection are unaffected.

The wlr portal names its stream nodes `xdpw-stream-*` (e.g. xdpw-stream-heAokj)
which did not match any screen-share name heuristic, so the privacy widget and
OSD never showed the screen-capture icon while sharing through it (used by
wlroots-based and other compositors like niri). Add `xdpw-stream` to the
recognized screen-share name prefixes.
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