diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/window_list.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/ui/window_list.c b/src/ui/window_list.c index 3a46f59e..c17ced50 100644 --- a/src/ui/window_list.c +++ b/src/ui/window_list.c @@ -1213,18 +1213,35 @@ wins_get_next_attention(void) values = g_list_sort(values, _wins_cmp_num); GList* curr = values; - while (curr) { - // copy from wins_get_next_unread - what is it? - if (current == GPOINTER_TO_INT(curr->data)) { + ProfWin* current_window = wins_get_by_num( current); + + // search the current window + while(curr) { + ProfWin* window = curr->data; + if( current_window == window ) { + current_window = window; curr = g_list_next(curr); - continue; + break; } + curr = g_list_next(curr); + } - ProfWin* window_current = wins_get_by_num( current); + // Start from current window + while ( current_window && curr) { ProfWin* window = curr->data; - if( window_current == window ) { - curr = g_list_next(curr); - continue; + if (win_has_attention(window)) { + g_list_free(values); + return window; + } + curr = g_list_next(curr); + } + // Start from begin + curr = values; + while ( current_window && curr) { + ProfWin* window = curr->data; + if( current_window == window) { + // we are at current again + break; } if (win_has_attention(window)) { g_list_free(values); |