mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Attention-flag: Fix next window
This commit is contained in:
parent
b9af7152f9
commit
47e39a7975
@ -1213,18 +1213,35 @@ wins_get_next_attention(void)
|
|||||||
values = g_list_sort(values, _wins_cmp_num);
|
values = g_list_sort(values, _wins_cmp_num);
|
||||||
GList* curr = values;
|
GList* curr = values;
|
||||||
|
|
||||||
while (curr) {
|
ProfWin* current_window = wins_get_by_num( current);
|
||||||
// copy from wins_get_next_unread - what is it?
|
|
||||||
if (current == GPOINTER_TO_INT(curr->data)) {
|
|
||||||
curr = g_list_next(curr);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProfWin* window_current = wins_get_by_num( current);
|
// search the current window
|
||||||
|
while(curr) {
|
||||||
ProfWin* window = curr->data;
|
ProfWin* window = curr->data;
|
||||||
if( window_current == window ) {
|
if( current_window == window ) {
|
||||||
|
current_window = window;
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
continue;
|
break;
|
||||||
|
}
|
||||||
|
curr = g_list_next(curr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start from current window
|
||||||
|
while ( current_window && curr) {
|
||||||
|
ProfWin* window = curr->data;
|
||||||
|
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)) {
|
if (win_has_attention(window)) {
|
||||||
g_list_free(values);
|
g_list_free(values);
|
||||||
|
Loading…
Reference in New Issue
Block a user