Compare commits

...

2 Commits

Author SHA1 Message Date
Pontus Andersson 3cf3d03ac8
Merge 07a9f4f1f8 into 646019cad9 2024-04-25 09:46:50 +08:00
Pontus Andersson 07a9f4f1f8 output: Fallback to sorting workspaces alphabetically
Currently the order of unnumbered workspaces is the order they were
created. This is a bit unintuitive for workflows where workspaces are
created and named dynamically.

Instead of treating all unnumbered workspaces equal, fallback to sorting
them alphabetically based on the name of the workspace. This will make
the ordering more deterministic regardless of the order they were
created.
2024-04-24 19:10:58 +02:00
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include "sway/tree/workspace.h"
#include "sway/server.h"
#include "log.h"
#include "stringop.h"
#include "util.h"
enum wlr_direction opposite_direction(enum wlr_direction d) {
@ -403,7 +404,7 @@ static int sort_workspace_cmp_qsort(const void *_a, const void *_b) {
} else if (isdigit(b->name[0])) {
return 1;
}
return 0;
return lenient_strcmp(a->name, b->name);
}
void output_sort_workspaces(struct sway_output *output) {