[hackers] wmii: new tip (= 1741)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon, 05 Feb 2007 08:40:05 +0100

changeset: 1741:17deb394ed0f
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Feb 05 02:36:18 2007 -0500
files: frame.c
description:
Ok, I *really* fixed the swapping bug this time.

diff -r c4125d9284a4 -r 17deb394ed0f frame.c
--- a/frame.c Mon Feb 05 02:09:14 2007 -0500
+++ b/frame.c Mon Feb 05 02:36:18 2007 -0500
@@ -75,11 +75,21 @@ swap_frames(Frame *fa, Frame *fb) {
         for(fp_b = &a->frame; *fp_b; fp_b=&(*fp_b)->anext)
                 if(*fp_b == fb) break;
 
- ft = fa->anext;
- *fp_a = fb;
- fa->anext = fb->anext;
- *fp_b = fa;
- fb->anext = ft;
+ if(fa->anext == fb) {
+ *fp_a = fb;
+ fa->anext = fb->anext;
+ fb->anext = fa;
+ } else if(fb->anext == fa) {
+ *fp_b = fa;
+ fb->anext = fa->anext;
+ fa->anext = fb;
+ } else {
+ *fp_a = fb;
+ *fp_b = fa;
+ ft = fb->anext;
+ fb->anext = fa->anext;
+ fa->anext = ft;
+ }
 
         fb->area = fa->area;
         fa->area = a;
Received on Mon Feb 05 2007 - 08:40:05 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:53 UTC