pop-os / cosmic-protocols

Addtional wayland-protocols used by the COSMIC desktop environment
30 stars 7 forks source link

Discussion: Work with wlroots to use their protocols rather than using a separate set #8

Open orowith2os opened 2 years ago

orowith2os commented 2 years ago

By design, Wayland has fragmentation in how protocols are handled, currently there being three main sets: KDE, GNOME, and wlroots.

I would suggest working with wlroots to use their protocols rather than using a separate set, so as to reduce fragmentation of the Linux desktop. This would also make it easier for utilities to support Cosmic, since they can just build for wlroots and it'll already work on Cosmic.

Drakulix commented 2 years ago

That is the plan, though we are not working directly with the wlroots folks, but try to upstream the used protocols:

As you can see there is active work going on for all protocols to reduce fragmentation long-term. We will continue making protocols, where functionality is lacking for features we want to provide. And I cannot promise you, that we won't end up with one or two private protocols for certain shell functionality, but we are actively trying to use established solutions and participate in developing new ones.

Additionally we are already using wlr-protocols, where they already seem a good fit. E.g. the wlr-layer-shell and the wlr-output-configuration protocol, which are both fully supported by cosmic-comp.

loligans commented 1 year ago

@Drakulix

  • cosmic-export-dmabuf-unstable-v1 is mostly a slightly edited version of the wlr-export-dmabuf protocol, but will be replaced by...

  • cosmic-screencopy-unstable-v1, which is based on ext-screencopy. This one is a little more tricky, because we want to be able to capture windows and workspaces, both options are currently not available in the proposed protocol. But options to support arbitrary sources have been discussed on IRC recently and a new version of said protocol should be able to cover our use cases.

You mentioned that cosmic-export-dmabuf-unstable-v1 will be replaced by cosmic-screencopy-unstable-v1. Does this mean that cosmic-screencopy-unstable-v1 will support both screen capture AND screen casting use cases? If not I think cosmic-export-dmabuf-unstable-v1 should probably be kept in order to support the screen casting use case

Drakulix commented 1 year ago

@Drakulix

You mentioned that cosmic-export-dmabuf-unstable-v1 will be replaced by cosmic-screencopy-unstable-v1. Does this mean that cosmic-screencopy-unstable-v1 will support both screen capture AND screen casting use cases? If not I think cosmic-export-dmabuf-unstable-v1 should probably be kept in order to support the screen casting use case

The protocol doesn't differentiate between what you do with the captured contents. (Stream or save to disk or whatever.)

As such both screen casting and recording use cases can be covered by it.

probonopd commented 12 months ago

Why cosmic-screencopy-unstable-v1 when there is already wlr-screencopy-unstable-v1?

Would it mean that existing tools that use wlr-screencopy-unstable-v1, such as wf-recorder -a, would not work without modification on Cosmic?

Why would anyone want such fragmentation?

PolyMeilex commented 11 months ago

Why cosmic-screencopy-unstable-v1 when there is already wlr-screencopy-unstable-v1?

Would it mean that existing tools that use wlr-screencopy-unstable-v1, such as wf-recorder -a, would not work without modification on Cosmic?

Why would anyone want such fragmentation?

It was already answered, wlr can't capture capture windows or workspaces. And as far as I understand cosmic wants to switch to ext_screencopy once it has needed features and is merged upstream, trying to use official protocol extension is opposite of fragmentation.

probonopd commented 11 months ago

Thanks for your expanation, looking forward to it then. It'd be so nice if all compositors supported all protocols. Currently every desktop environment has some things that work in Wayland and others that are broken.

Wouldn't it be sensible to standardize on wlroots and let it handle the rest?

Consolatis commented 11 months ago

Wouldn't it be sensible to standardize on wlroots and let it handle the rest?

The wlroots protocol does not support capturing single windows. So unless cosmic wants to implement both protocols (which would be possible be also somewhat redundant) it would loose the ability to capture single windows.

Usually how screencapture / screencast works in wayland from an application point of view (e.g. OBS or similar) is via a xdg-desktop portal interface so the actual wayland protocol in use doesn't really matter as the abstraction in this case is via the xdg-desktop portal interface. That does mean however that tools that directly use the wayland protocol (like wf-recorder) won't work.

probonopd commented 11 months ago

That there is no Portals involved makes wf-recorder -a so great and simple if you "just want to record your screen with audio coming from the microphone", as is a common use case.