-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switchcol but for swapping selected window in stack with master #406
Comments
Yes probably, it sounds a bit like zoomswap. |
Zoomswap would be good if after swapping with the master window, the switchcol hotkey returned to the same place in the stack. Instead switchcol shifts focus to the window in the stack that was focused prior to the one swapped with the master |
dwm-flexipatch/patch/switchcol.c Lines 1 to 28 in 5a0c5e6
That is not entirely accurate. The function loops through the stacking order, i.e. the order in which windows received focused going from most recent to oldest. Let's say that you have a master window and three windows 1, 2, 3 in the stack area. You use MOD+v (switchcol) to move from the master area to the stack area and you land on the first window 1. Four example scenarios:
Window 2 is the window that most recently have focus, window 1 is the one after that. You do MOD+Return to trigger zoomswap replacing the master window with window 2. Window 2 retains focus. You now do MOD+v to trigger switchcol. The first window in the stack is window 2 - which is the selected client. We are in the master area and the selected client is in the master area so we go to the stack area. The next client in the stack is tried and this is Window 1. That window is in the stack area and thus it ends up receiving focus.
Now you do MOD+Return to trigger zoomswap replacing the master window with window 2. You now do MOD+v to trigger switchcol. The outcome is that Window 3 gets focus as that is the window in the stack area that most recently had focus.
You do MOD+Return to trigger zoomswap replacing the master window with window 2. You now do MOD+Return to trigger zoomswap replacing window 2 with the original master window. The master window receives focus. You do MOD+Return once more to trigger zoomswap replacing the master window with window 2. Then you do MOD+v to trigger switchcol. The outcome is that the master window in the stack area gets focus because that is the window in the stack area that most recently had focus.
All in all it seems to work as intended. But I can see how this might be annoying for this particular workflow so one might work around this by moving the master window to the top of the stack before swapping. diff --git a/dwm.c b/dwm.c
index fa51816..1081043 100644
--- a/dwm.c
+++ b/dwm.c
@@ -5171,6 +5171,8 @@ zoom(const Arg *arg)
c->mon->tagmarked[i] = cold;
#endif // FOCUSMASTER_RETURN_PATCH
+ detachstack(cold);
+ attachstack(cold);
detach(c);
attach(c);
/* swap windows instead of pushing the previous one down */ I don't have it included in dwm-flexipatch but the masterstacker patch might also be an alternative. |
I have switchcol on super+space hotkey and I would like to have something like switchcol-swap on super+shift+space.
Do you have any patch for it? It would be great
The text was updated successfully, but these errors were encountered: