X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/d939f301fa5ee472f2b089496b5e873ec155fa8e..0b7c0f10eeee1c473b1adcee3a8b90db61b854e9:/view.c?ds=inline diff --git a/view.c b/view.c index 793151d..b72e4d5 100644 --- a/view.c +++ b/view.c @@ -32,17 +32,21 @@ pop(Client *c) { static void swap(Client *c1, Client *c2) { Client tmp = *c1; - Client *cp = c1->prev; - Client *cn = c1->next; + Client *c1p = c1->prev; + Client *c1n = c1->next; + Client *c1s = c1->snext; + Client *c2p = c2->prev; + Client *c2n = c2->next; + Client *c2s = c2->snext; *c1 = *c2; - c1->prev = cp; - c1->next = cn; - cp = c2->prev; - cn = c2->next; *c2 = tmp; - c2->prev = cp; - c2->next = cn; + c1->prev = c1p; + c1->next = c1n; + c1->snext = c1s; + c2->prev = c2p; + c2->next = c2n; + c2->snext = c2s; } static void @@ -192,10 +196,9 @@ focusprev(Arg *arg) { void incnmaster(Arg *arg) { - if(nmaster + arg->i < 1 || (wah / (nmaster + arg->i) < bh)) + if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; - arrange(); } @@ -305,7 +308,9 @@ zoom(Arg *arg) { n++; c = sel; - if(n <= nmaster || (arrange == dofloat)) + if(arrange == dofloat) + return; + else if(n <= nmaster) pop(c); else if(ismaster(sel)) { if(!(c = topofstack()))