1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Change active_window to select, when there is more than one window

with the highest data level, the window with the lowest refnum.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4538 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2007-06-04 09:59:03 +00:00 committed by exg
parent c0674522ae
commit b228bb30f5

View File

@ -249,11 +249,11 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
{
WINDOW_REC *rec, *max_win;
GSList *tmp;
int max_act, through;
int max_act, max_ref, through;
g_return_val_if_fail(window != NULL, NULL);
max_win = NULL; max_act = 0; through = FALSE;
max_win = NULL; max_act = 0; max_ref = 0; through = FALSE;
tmp = g_slist_find(windows, window);
for (;; tmp = tmp->next) {
@ -267,9 +267,12 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
rec = tmp->data;
if (rec->data_level > 0 && max_act < rec->data_level) {
if (rec->data_level > 0 &&
(rec->data_level > max_act ||
(rec->data_level == max_act && rec->refnum < max_ref))) {
max_act = rec->data_level;
max_win = rec;
max_ref = rec->refnum;
}
}