Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cosmic-screencopy-v2 based on current ext-screencopy proposal #24

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

Drakulix
Copy link
Member

(Also drops export-dmabuf.)

Draft until implemented everywhere

@ids1024
Copy link
Member

ids1024 commented Mar 11, 2024

At some point we'll also want to switch this to make use of ext-foreign-toplevel-list-v1 (pop-os/cosmic-comp#76).

@ids1024
Copy link
Member

ids1024 commented Mar 14, 2024

Added a commit with cosmic-client-toolkit helpers for this. Which is used in pop-os/xdg-desktop-portal-cosmic#31. The separate object for individual frames does seem a bit cleaner, and this implementation is more complete than the one that was previously here for v1. (But still missing handling for cursor sessions.)

Still needs to be implemented in cosmic-workspaces. And hopefully some of the logic that both xdg-desktop-portal-cosmic and cosmic-workspaces duplicate could be moved into cosmic-client-toolkit.

pub struct Frame {
pub transform: WEnum<Transform>,
pub damage: Vec<Rect>,
// XXX monotonic? Is this used elsewhere in wayland?
Copy link
Member Author

@Drakulix Drakulix Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically the same as presentation time protocol.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. So that's using Into<Duration>? Then we don't have a better type than Duration currently to represent this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In smithay this is using our own Clock- and Time-types from the utils module. Which happens to convert from a Duration. And no I don't think we have a better type in std.

pub fn capture<D, U: ScreencopyFrameDataExt + Send + Sync + 'static>(
session: &zcosmic_screencopy_session_v2::ZcosmicScreencopySessionV2,
buffer: &wl_buffer::WlBuffer,
buffer_damage: &[Rect],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe lets name that "additional_damage"? Or something? Normally you don't want to set anything here.

@Drakulix Drakulix marked this pull request as ready for review March 25, 2024 14:33
@Drakulix Drakulix merged commit 1cc4a13 into main Mar 25, 2024
4 checks passed
@Drakulix Drakulix deleted the ext-screencopy branch July 3, 2024 19:54
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.

None yet

2 participants