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.
This commit is contained in:
parent
96cbaad7b7
commit
7340e2beff
11 changed files with 61 additions and 69 deletions
|
|
@ -725,7 +725,6 @@ impl State {
|
|||
false,
|
||||
&state.common.config,
|
||||
&state.common.event_loop_handle,
|
||||
&state.common.xdg_activation_state,
|
||||
false,
|
||||
);
|
||||
drop(shell);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue