summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-06-04 09:59:03 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-06-04 09:59:03 +0000
commitb228bb30f5c89767db42e5cd27ae11143b456bb6 (patch)
tree8f3f110b84c5f226de431e12a6ffda8bca54c2ed /src/fe-common
parentc0674522aec98aaf588e524ba35ec352f4ff7710 (diff)
downloadirssi-b228bb30f5c89767db42e5cd27ae11143b456bb6.zip
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
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/window-commands.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c
index 26678a90..8ffeb046 100644
--- a/src/fe-common/core/window-commands.c
+++ b/src/fe-common/core/window-commands.c
@@ -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;
}
}