From: Christian Heller Date: Tue, 30 Jul 2013 01:44:48 +0000 (+0200) Subject: In shift_active_win() slightly improved formatting and solved a "why is this needed... X-Git-Tag: tce~1112 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/blog?a=commitdiff_plain;h=a69666dfbbc1c27f0b29f4a591a69630c470df87;p=plomrogue In shift_active_win() slightly improved formatting and solved a "why is this needed" comment question. --- diff --git a/src/windows.c b/src/windows.c index 362e10a..7e0ba72 100644 --- a/src/windows.c +++ b/src/windows.c @@ -436,16 +436,18 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir) wrap = 1; } - /* Suspend all visible windows. */ + /* Suspend all visible windows, remember their order in wins[]. */ uint16_t i, i_max; - for (w_p = wmeta->chain_start, i_max = 1; + for (w_p = wmeta->chain_start, i_max = 1; w_p != wmeta->chain_end; - w_p = w_p->next) + w_p = w_p->next) { i_max++; } struct Win ** wins = malloc(i_max * sizeof(struct Win *)); - for (i = 0, w_p = wmeta->chain_start; i < i_max; i++) + for (i = 0, w_p = wmeta->chain_start; + i < i_max; + i++) { w_p_next = w_p->next; suspend_win(wmeta, w_p); @@ -492,7 +494,7 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir) } free(wins); - wmeta->active = w_shift; /* TODO: Is this necessary? If so, why? */ + wmeta->active = w_shift; /* Otherwise lastly appended win is active. */ } }