Skip to content

Commit

Permalink
Sort coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Feb 10, 2025
1 parent 8d46a2a commit 6568a1a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client-toolkit/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ where
.chunks(4)
.map(|chunk| u32::from_ne_bytes(chunk.try_into().unwrap()))
.collect();
// Keep `.workspaces` sorted by `coordinates`
let group = state
.workspace_state()
.workspace_groups
.iter_mut()
.find(|group| group.workspaces.iter().any(|w| &w.handle == handle))
.unwrap();
group
.workspaces
.sort_by(|w1, w2| w1.coordinates.cmp(&w2.coordinates));
}
zcosmic_workspace_handle_v1::Event::State { state } => {
workspace.state = state
Expand Down

0 comments on commit 6568a1a

Please sign in to comment.