cosmic-comp/src/shell/element
Ian Douglas Scott 7340e2beff Improve handling of XDG activation tokens in shell
Requires https://github.com/Smithay/smithay/pull/1676.

This changes two things:
* `Workspace::is_empty` no longer checks if there are activation tokens,
  but a separate `Workspace::can_auto_remove` checks if the workspace is
  empty and has no activation tokens.
  - When we add workspace pinning, that can also be checked there.
* `Workspace` no longer contains a `pending_tokens` list that is updated
  on `refresh`. Instead, `can_auto_remove` takes the xdg activation
  state as an argument.

Since `Workspace::refresh` normally is run for focused workspaces, this
fixes allowing non-focused workspaces to be removed when an activation
token expires. It seems generally good to avoid tracking the activation
tokens in two places, and this is probably more efficient than needing
to refresh in more places.

By splitting this, we still don't remove an empty workspace if it has a
pending activation token, but we also don't add an empty workspace for
an activation token.

This mitigates the confusing behavior with activation tokens that aren't
used, but having to wait a few seconds in some cases before a workspace
is removed is still a little confusing. (We probably want `cosmic-term`
and `cosmic-workspace` to either consume the activation tokens they are
passed, or not be passed tokens when started by keybinding?)

Fixes https://github.com/pop-os/cosmic-comp/issues/1099.
2025-03-14 17:53:34 +01:00
..
stack chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
mod.rs chore: smithay update 2025-03-12 16:50:58 +01:00
resize_indicator.rs chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
stack.rs Improve handling of XDG activation tokens in shell 2025-03-14 17:53:34 +01:00
stack_hover.rs chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
surface.rs chore: smithay update 2025-03-12 16:50:58 +01:00
swap_indicator.rs chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
window.rs Improve handling of XDG activation tokens in shell 2025-03-14 17:53:34 +01:00