mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
window_item_create(): when there's multiple choices where the window
item could be placed, the first window is now selected instead of the last accessed one of them (which most people think of as a random window). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1040 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
acf60a729c
commit
219c83ae6a
4 changed files with 26 additions and 19 deletions
|
|
@ -363,6 +363,26 @@ int windows_refnum_last(void)
|
|||
return max;
|
||||
}
|
||||
|
||||
static int window_refnum_cmp(WINDOW_REC *w1, WINDOW_REC *w2)
|
||||
{
|
||||
return w1->refnum < w2->refnum ? -1 : 1;
|
||||
}
|
||||
|
||||
GSList *windows_get_sorted(void)
|
||||
{
|
||||
GSList *tmp, *sorted;
|
||||
|
||||
sorted = NULL;
|
||||
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
|
||||
WINDOW_REC *rec = tmp->data;
|
||||
|
||||
sorted = g_slist_insert_sorted(sorted, rec, (GCompareFunc)
|
||||
window_refnum_cmp);
|
||||
}
|
||||
|
||||
return sorted;
|
||||
}
|
||||
|
||||
static void sig_server_looking(SERVER_REC *server)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue