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

client-toolkit/toplevel-info: Work with only ext foreign toplevel #49

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Feb 3, 2025

Supporting both cosmic toplevel info version 1 and foreign toplevel list (with cosmic toplevel info) seems awkward. So this initially make the cosmic-protocol mandatory and the ext protocol optional (without breaking the API). But now that Cosmic has supported this for a while, lets drop client-side support for the old version, and add support for other compositors implementing ext-foreign-toplevel-list-v1.

I still need to update users of the library for this. Probably after #46. Looks like ext_foreign_toplevel_image_capture_source_manager_v1 isn't currently implemented by Sway? So this doesn't yet capture windows on Sway.

This makes `foreign_toplevel` in `ToplevelInfo` no longer an `Option`.

Cosmic-comp has supported version 2 of this protocol for a while, so
supporting version 1 is no longer necessary.
With this, `toplevel-monitor` works on Sway, but doesn't have the
information exposed through the Cosmic protocol, naturally.

The API is changed to use `ExtForeignToplevelHandleV1`. For convenience,
`ToplevelInfo` contains the foreign handle, and the optional cosmic
handle.

I assume `identifier` is meant to be mandatory, so that is no longer an
`Option` here. Though there's no check that the server sends this (is
server-side code, this would send a protocol error; I guess cctk could
panic, or log an error.)
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