aboutsummaryrefslogtreecommitdiff
path: root/src/con.c
diff options
context:
space:
mode:
authorrsgowman <richard.gowman@gmail.com>2024-02-06 14:28:20 -0500
committerGitHub <noreply@github.com>2024-02-06 20:28:20 +0100
commit6a530de22049d7ce8575d1fdd393654260a25234 (patch)
tree6e1184fad02a2cc3149abd3e5f2eba57f89ee867 /src/con.c
parent063916718505162b5ebe22268e413787cba32642 (diff)
downloadi3-6a530de22049d7ce8575d1fdd393654260a25234.tar.gz
i3-6a530de22049d7ce8575d1fdd393654260a25234.zip
Create new workspaces to the right of existing ones with the same number
i.e. creating workspaces named "1", "2:a", "2:b", "3" should result in that same order rather than "1", "2:b", "2:a", "3".
Diffstat (limited to 'src/con.c')
-rw-r--r--src/con.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/con.c b/src/con.c
index 917e797a..abcc4fba 100644
--- a/src/con.c
+++ b/src/con.c
@@ -116,14 +116,14 @@ static void _con_attach(Con *con, Con *parent, Con *previous, bool ignore_focus)
/* we need to insert the container at the beginning */
TAILQ_INSERT_HEAD(nodes_head, con, nodes);
} else {
- while (current->num != -1 && con->num > current->num) {
+ while (current->num != -1 && con->num >= current->num) {
current = TAILQ_NEXT(current, nodes);
if (current == TAILQ_END(nodes_head)) {
current = NULL;
break;
}
}
- /* we need to insert con after current, if current is not NULL */
+ /* we need to insert con before current, if current is not NULL */
if (current) {
TAILQ_INSERT_BEFORE(current, con, nodes);
} else {