X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=9bd75846f7f32f8bd9cb6c1d61ceb2a9c82c4161;hb=51f6405b0d7a9ba34696cafbc08303b1e5b14cfa;hp=b4de57383f6f3c015e6a7a798464775afb54fdf3;hpb=0faaba04a589c288a3f117f6c5b2c259c2b6790d;p=dwm.git diff --git a/view.c b/view.c index b4de573..9bd7584 100644 --- a/view.c +++ b/view.c @@ -32,17 +32,17 @@ 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 *c2p = c2->prev; + Client *c2n = c2->next; *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; + c2->prev = c2p; + c2->next = c2n; } static void @@ -192,7 +192,7 @@ focusprev(Arg *arg) { void incnmaster(Arg *arg) { - if(nmaster + arg->i < 1) + if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; arrange(); @@ -304,7 +304,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()))