diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-30 00:11:56 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-30 00:11:56 +0000 |
commit | 965def294b3787052a9285ef22d6b01cd41a2ebe (patch) | |
tree | b9ba924411f644b629895fa81d374c23a4ba2b06 | |
parent | d549526735bb77830e432be7e432eccbd42698ed (diff) | |
download | irssi-965def294b3787052a9285ef22d6b01cd41a2ebe.zip |
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
-rw-r--r-- | src/fe-common/core/windows.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/fe-common/core/windows.c b/src/fe-common/core/windows.c index e08a6c1a..c5f345f7 100644 --- a/src/fe-common/core/windows.c +++ b/src/fe-common/core/windows.c @@ -361,22 +361,24 @@ int windows_refnum_last(void) return max; } -static void sig_server_looking(void *server) +static void sig_server_looking(SERVER_REC *server) { GSList *tmp; 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) { WINDOW_REC *rec = tmp->data; - if (rec->active_server == NULL) - window_change_server(rec, server); + if (rec->active_server == NULL || + (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; SERVER_REC *new_server; |