Skip to content

foreign-toplevel: support capturing windows.#3044

Closed
lcolitti wants to merge 1 commit into
WayfireWM:masterfrom
lcolitti:share-windows
Closed

foreign-toplevel: support capturing windows.#3044
lcolitti wants to merge 1 commit into
WayfireWM:masterfrom
lcolitti:share-windows

Conversation

@lcolitti

Copy link
Copy Markdown
Contributor

This commit adds support for capturing windows using foreign_toplevel_image_capture_source_manager.

Tested using Chrome webrtc screensharing via xdg-desktop-portal.

@soreau

soreau commented Jun 13, 2026

Copy link
Copy Markdown
Member

This is a NAK from me. Wayfire doesn't use wlr_scene and the wlr_scene implementation for foreign-toplevels is subpar compared to the wf-copy-capture plugin. For example when I tried it, it did not support resizing toplevels or even mouse cursor support. It was also very buggy for renderings in general. Currently to capture toplevels, enable the ext-toplevel and wf-copy-capture plugins and run a toplevel copy capture client.

This commit adds support for capturing windows using
foreign_toplevel_image_capture_source_manager.

Tested using Chrome webrtc screensharing via xdg-desktop-portal.
@soreau

soreau commented Jun 13, 2026

Copy link
Copy Markdown
Member

Other foreign-toplevel copy capture test clients you can try are:

@ammen99

ammen99 commented Jun 13, 2026

Copy link
Copy Markdown
Member

@lcolitti Thanks for the PR. As @soreau already explained, he has gotten a version working with a custom implementation which supports many features. Your current implementation is close to what I'd have done myself (using wlr_scene) but the issue is that Wayfire supports custom subsurfaces like the decoration plugins, which wlroots does not know about and thus wouldn't be included with your current approach. If we wanted to use wlr_scene, I'd personally render to an aux buffer and then attach that buffer as a wlr scene node.

@lcolitti

Copy link
Copy Markdown
Contributor Author

Thanks for the quick response. I didn't know about wf-copy-capture. I'll just tried it. I was able to get it to share Chrome windows for a while but then wayfire segfaulted (without a stacktrace, otherwise I'd open an issue). I'll poke at it some more.

@lcolitti lcolitti closed this Jun 13, 2026
@soreau

soreau commented Jun 13, 2026

Copy link
Copy Markdown
Member

@lcolitti If you do file an issue, please make it on the wf-copy-capture repo. I am curious to know what steps you took to crash it.

@lcolitti

Copy link
Copy Markdown
Contributor Author

Filed soreau/wf-copy-capture#2 .

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.

3 participants