@@ -161,7 +161,7 @@ void resetsnap(Client *c) {
161161        return ;
162162    if  (c -> isfloating  ||  NULL  ==  selmon -> lt [selmon -> sellt ]-> arrange  ) {
163163        c -> snapstatus  =  0 ;
164-         c -> bw   =   c -> oldbw ;
164+         restorebw ( c ) ;
165165        restorefloating (c );
166166        applysize (c );
167167    }
@@ -199,7 +199,7 @@ void restoreallfloating(Monitor *m) {
199199void  applysnap (Client  * c , Monitor  * m ) {
200200    int  mony  =  m -> my  +  (bh  *  m -> showbar );
201201    if  (c -> snapstatus  !=  9 )
202-         c -> bw   =   c -> oldbw ;
202+         restorebw ( c ) ;
203203    switch  (c -> snapstatus ) {
204204        case  0 :
205205            checkanimate (c , c -> sfx , c -> sfy , c -> sfw , c -> sfh , 7 , 0 );
@@ -229,7 +229,7 @@ void applysnap(Client *c, Monitor *m) {
229229            checkanimate (c , m -> mx , mony , m -> mw  / 2 , m -> mh  / 2 , 7 , 0 );
230230            break ;
231231        case  9 :
232-             c -> oldbw   =   c -> bw ;
232+             savebw ( c ) ;
233233            c -> bw  =  0 ;
234234            checkanimate (c , m -> mx , mony , m -> mw  -  c -> bw  *  2 , m -> mh  +  c -> bw  *  2 , 7 , 0 );
235235            if  (c  ==  selmon -> sel )
@@ -4779,8 +4779,8 @@ togglefloating(const Arg *arg)
47794779		animateclient (selmon -> sel , selmon -> sel -> sfx , selmon -> sel -> sfy ,
47804780		       selmon -> sel -> sfw , selmon -> sel -> sfh , 7 , 0 );
47814781	} else  {
4782-         if  (clientcount () ==  1 ) {
4783-             selmon -> sel -> oldbw   =   selmon -> sel -> bw ;
4782+         if  (clientcount () ==  1   &&  ! selmon -> sel -> snapstatus ) {
4783+             savebw ( selmon -> sel ) ;
47844784            selmon -> sel -> bw  =  0 ;
47854785        }
47864786		XSetWindowBorder (dpy , selmon -> sel -> win , scheme [SchemeSel ][ColBorder ].pixel );
0 commit comments