From 4cd111d9d1356db27f6c90b9c95144f9c409ec54 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Mon, 23 Jun 2025 20:52:58 +0100 Subject: add new_win_master new windows spawned can now be set as master window --- src/sxwm.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/sxwm.c') diff --git a/src/sxwm.c b/src/sxwm.c index b223207..7b35b09 100644 --- a/src/sxwm.c +++ b/src/sxwm.c @@ -12,7 +12,7 @@ * will use this will probably be programmers :) * * (C) Abhinav Prasai 2025 - */ +*/ #include #include @@ -173,11 +173,17 @@ Client *add_client(Window w, int ws) workspaces[ws] = c; } else { - Client *tail = workspaces[ws]; - while (tail->next) { - tail = tail->next; + if (user_config.new_win_master) { + c->next = workspaces[ws]; + workspaces[ws] = c; + } + else { + Client *tail = workspaces[ws]; + while (tail->next) { + tail = tail->next; + } + tail->next = c; } - tail->next = c; } open_windows++; @@ -1437,6 +1443,7 @@ void init_defaults(void) default_config.bindsn = 0; default_config.new_win_focus = True; default_config.warp_cursor = True; + default_config.new_win_master = False; if (backup_binds) { for (unsigned long i = 0; i < LENGTH(binds); i++) { -- cgit v1.2.3