[Singularity scrrencasting fixes #1]:Add JSON source selection for screencasts with monitor and window support - #3
Open
mateoalfaro wants to merge 1 commit into
Open
Conversation
- Pass source lists to the chooser over stdin as JSON - Support monitor and window sources end to end - Update backend session handling and format negotiation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Singularity screencast portal so screen and window sharing work reliably with Discord, OBS, and other xdg-desktop-portal clients.
This PR adds proper source selection for monitor/window capture, hardens the singleton screencast backend lifecycle across repeated share attempts, and fixes SHM/PipeWire format handling for compositors that advertise BGR888.
What Changed:
Added monitor/window source selection support for the screencast chooser.
Added backend session ownership tracking so stale portal sessions cannot interfere with the active capture.
Hardened screencast teardown/restart handling:
cancels pending frame retry timers
disconnects/destroys PipeWire streams consistently
ignores stale Wayland session/frame callbacks
prevents duplicate in-flight frames
detects failed Wayland connections after protocol errors
Added support for 24-bit SHM capture formats:
WL_SHM_FORMAT_BGR888
WL_SHM_FORMAT_RGB888
Fixed SHM stride calculation to use the selected capture format’s bytes-per-pixel instead of always assuming 4 bytes per pixel.
Kept PipeWire output as consumer-friendly SPA_VIDEO_FORMAT_BGRx.
Added conversion from captured SHM formats into PipeWire BGRx.
Fixed 24-bit channel order so captured colors are not inverted/tinted.
Bugs Fixed:
Discord/Electron apps did not trigger the screencast picker UI correctly.
Repeated share attempts could fail after the first successful stream.
OBS/Discord could report the share as denied/cancelled after selecting a source.
BGR888 was rejected as unsupported.
BGR888 capture could cause invalid Wayland SHM stride errors.
Streams could start but show incorrect/inverted colors.
Tested with: NixOS 26.05