diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 2b710403..49ec806e 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -1,5 +1,4 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <ctype.h> | ||
3 | #include <math.h> | 2 | #include <math.h> |
4 | #include <stdbool.h> | 3 | #include <stdbool.h> |
5 | #include <stdlib.h> | 4 | #include <stdlib.h> |
@@ -591,28 +590,6 @@ enum sway_container_layout container_get_default_layout( | |||
591 | } | 590 | } |
592 | } | 591 | } |
593 | 592 | ||
594 | static int sort_workspace_cmp_qsort(const void *_a, const void *_b) { | ||
595 | struct sway_container *a = *(void **)_a; | ||
596 | struct sway_container *b = *(void **)_b; | ||
597 | int retval = 0; | ||
598 | |||
599 | if (isdigit(a->name[0]) && isdigit(b->name[0])) { | ||
600 | int a_num = strtol(a->name, NULL, 10); | ||
601 | int b_num = strtol(b->name, NULL, 10); | ||
602 | retval = (a_num < b_num) ? -1 : (a_num > b_num); | ||
603 | } else if (isdigit(a->name[0])) { | ||
604 | retval = -1; | ||
605 | } else if (isdigit(b->name[0])) { | ||
606 | retval = 1; | ||
607 | } | ||
608 | |||
609 | return retval; | ||
610 | } | ||
611 | |||
612 | void container_sort_workspaces(struct sway_container *output) { | ||
613 | list_stable_sort(output->children, sort_workspace_cmp_qsort); | ||
614 | } | ||
615 | |||
616 | /** | 593 | /** |
617 | * Get swayc in the direction of newly entered output. | 594 | * Get swayc in the direction of newly entered output. |
618 | */ | 595 | */ |