mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-16 22:31:03 +02:00
fix(workspaces): niri workspaces not respecting added
sort (#911)
* refactor: sort niri workspaces before init * chore: comment for ordered_niri_workspace changing
This commit is contained in:
parent
66bdac52d6
commit
3320cf27b2
1 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,11 @@ impl Client {
|
|||
let mut updates: Vec<WorkspaceUpdate> = vec![];
|
||||
|
||||
if first_event {
|
||||
updates.push(WorkspaceUpdate::Init(new_workspaces.clone()));
|
||||
// Niri's WorkspacesChanged event does not initially sort workspaces by ID when first output,
|
||||
// which makes sort = added meaningless. Therefore, new_workspaces are sorted by ID here to ensure a consistent addition order.
|
||||
let mut new_workspaces = new_workspaces.clone();
|
||||
new_workspaces.sort_by_key(|w| w.id);
|
||||
updates.push(WorkspaceUpdate::Init(new_workspaces));
|
||||
first_event = false;
|
||||
} else {
|
||||
// first pass - add/update
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue