protocol/workspace: Fix behavior with multiple manager instances

Similarly to https://github.com/pop-os/cosmic-comp/pull/1061, track a
weak reference to the manager each workspace/group instance was created
from, instead of just matching by client.
This commit is contained in:
Ian Douglas Scott 2025-02-12 18:32:01 -08:00 • committed by Victoria Brekenfeld
parent 723f758439
commit 2728a9ee71
4 changed files with 65 additions and 69 deletions

View file

@ -590,7 +590,7 @@ where
.iter()
.filter(|w| !handle_state.workspaces.contains(w))
{
if let Some(handle) = workspace_state.raw_workspace_handle(&new_workspace, &instance.id()) {
for handle in workspace_state.raw_workspace_handles(&new_workspace, &instance.id()) {
instance.workspace_enter(&handle);
changed = true;
}
@ -600,7 +600,7 @@ where
.iter()
.filter(|w| !state.workspaces.contains(w))
{
if let Some(handle) = workspace_state.raw_workspace_handle(&old_workspace, &instance.id()) {
for handle in workspace_state.raw_workspace_handles(&old_workspace, &instance.id()) {
instance.workspace_leave(&handle);
changed = true;
}