mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
When connecting to server, change the active window's server if the
window is empty. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@698 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d549526735
commit
965def294b
@ -361,22 +361,24 @@ int windows_refnum_last(void)
|
|||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sig_server_looking(void *server)
|
static void sig_server_looking(SERVER_REC *server)
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
|
|
||||||
g_return_if_fail(server != NULL);
|
g_return_if_fail(server != NULL);
|
||||||
|
|
||||||
/* try to keep some server assigned to windows.. */
|
/* Try to keep some server assigned to windows..
|
||||||
|
Also change active window's server if the window is empty */
|
||||||
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
|
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
|
||||||
WINDOW_REC *rec = tmp->data;
|
WINDOW_REC *rec = tmp->data;
|
||||||
|
|
||||||
if (rec->active_server == NULL)
|
if (rec->active_server == NULL ||
|
||||||
window_change_server(rec, server);
|
(rec == active_win && rec->items == NULL))
|
||||||
|
window_change_server(active_win, server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sig_server_disconnected(void *server)
|
static void sig_server_disconnected(SERVER_REC *server)
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
SERVER_REC *new_server;
|
SERVER_REC *new_server;
|
||||||
|
Loading…
Reference in New Issue
Block a user