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

Support ext-workspace-v1 #1213

Merged
merged 3 commits into from
Feb 13, 2025
Merged

Support ext-workspace-v1 #1213

merged 3 commits into from
Feb 13, 2025

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Feb 12, 2025

This should work, though I still need to test with a client.

This doesn't yet add an extension protocol (pop-os/cosmic-protocols#51). We could merge this without that (after some testing) but we'll want to add that soon.

@Drakulix
Copy link
Member

Looks good on first read apart from the lack of testing obviously. Seems like a good approach to me.

@ids1024
Copy link
Member Author

ids1024 commented Feb 12, 2025

I guess one thing I'm missing here is sending ext_workspace_group_handle_v1::workspace_enter and workspace_leave. I guess the old revision of the protocol didn't allow moving a workspace to a different group.

We can do the same for now, sending workspace_enter on creation, and never sending workspace_leave. When we drop the old protocol, we can change from creating new handles on moving a workspace to sending workspace_leave/workspace_enter.

@ids1024
Copy link
Member Author

ids1024 commented Feb 12, 2025

After updating pop-os/cosmic-protocols#51 with cctk changes, and sending workspace_enter here, this seems to be working. (Of course, it's that client doesn't see the v2 extension protocol, which isn't implemented here yet.)

To support both `ext-workspace-v1` and `cosmic-workspace-unstable-v1`,
the API exposed by `wayland/protocols/workspace` now uses the ext
workspace `State` and `GroupCapabilties` bitfields, and converts them to
the cosmic types for the cosmic implementation.

`WorkspaceCapabilities` is a custom type that has cosmic-specific and
ext-specific variants, and is mapped on both backends.

The ext protocol adds an `.assign` request on workspaces, which is
added here, though not currently used.

It also adds an `.id` event. Which we'll probably want when we have
persistent workspaces, but it isn't needed currently.

We still need to add an extension protocol of ext-workspaces to replace
a couple cosmic protocol features.
@ids1024 ids1024 marked this pull request as ready for review February 13, 2025 00:18
@ids1024 ids1024 requested a review from a team February 13, 2025 00:18
@ids1024 ids1024 marked this pull request as draft February 13, 2025 00:20
@ids1024
Copy link
Member Author

ids1024 commented Feb 13, 2025

Oh, I guess I still need to make sure it sends workspace_leave only for workspaces from the same manager instance.

(Relatedly, this needs a fix like #1061. I guess we don't currently have any clients that end up binding the workspaces protocol in two places.)

Similarly to #1061, track a
weak reference to the manager each workspace/group instance was created
from, instead of just matching by client.
@ids1024 ids1024 marked this pull request as ready for review February 13, 2025 02:33
@Drakulix Drakulix merged commit 2728a9e into master Feb 13, 2025
7 of 9 checks passed
@Drakulix Drakulix deleted the ext-workspace branch February 13, 2025 10:31
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.

2 participants