mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Restore the behaviour of active_window to go to the window with most recent activity
between the ones with highest data level, and make actlist_sort = level match this ordering. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4798 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
68763eb4e8
commit
c280030608
@ -249,11 +249,11 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
|
|||||||
{
|
{
|
||||||
WINDOW_REC *rec, *max_win;
|
WINDOW_REC *rec, *max_win;
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
int max_act, max_ref, through;
|
int max_act, through;
|
||||||
|
|
||||||
g_return_val_if_fail(window != NULL, NULL);
|
g_return_val_if_fail(window != NULL, NULL);
|
||||||
|
|
||||||
max_win = NULL; max_act = 0; max_ref = 0; through = FALSE;
|
max_win = NULL; max_act = 0; through = FALSE;
|
||||||
|
|
||||||
tmp = g_slist_find(windows, window);
|
tmp = g_slist_find(windows, window);
|
||||||
for (;; tmp = tmp->next) {
|
for (;; tmp = tmp->next) {
|
||||||
@ -267,12 +267,9 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
|
|||||||
|
|
||||||
rec = tmp->data;
|
rec = tmp->data;
|
||||||
|
|
||||||
if (rec->data_level > 0 &&
|
if (rec->data_level > 0 && max_act < rec->data_level) {
|
||||||
(rec->data_level > max_act ||
|
|
||||||
(rec->data_level == max_act && rec->refnum < max_ref))) {
|
|
||||||
max_act = rec->data_level;
|
max_act = rec->data_level;
|
||||||
max_win = rec;
|
max_win = rec;
|
||||||
max_ref = rec->refnum;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,8 +154,7 @@ static void item_act(SBAR_ITEM_REC *item, int get_size_only)
|
|||||||
|
|
||||||
static int window_level_cmp(WINDOW_REC *w1, WINDOW_REC *w2)
|
static int window_level_cmp(WINDOW_REC *w1, WINDOW_REC *w2)
|
||||||
{
|
{
|
||||||
if (w1->data_level > w2->data_level ||
|
if (w1->data_level >= w2->data_level)
|
||||||
(w1->data_level == w2->data_level && w1->refnum < w2->refnum))
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user