diff options
author | Timo Sirainen <cras@irssi.org> | 2001-03-03 22:03:00 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-03-03 22:03:00 +0000 |
commit | 1a61f989e1b010200942e4693fadbd1119d1e783 (patch) | |
tree | c7e9950e61b8d06782110c03667dbe34bc3c011e /src | |
parent | ab5166033cf5dd55934c38ed3f6c93a2c3ef872c (diff) | |
download | irssi-1a61f989e1b010200942e4693fadbd1119d1e783.zip |
When /SET autoclose_windows is ON, don't destroy windows if they have
some level set (like /join -w + /part in status window)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1327 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-channels.c | 7 | ||||
-rw-r--r-- | src/fe-common/core/fe-queries.c | 5 | ||||
-rw-r--r-- | src/fe-common/core/fe-windows.c | 7 | ||||
-rw-r--r-- | src/fe-common/core/fe-windows.h | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 4bbbcbda..6175cb55 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -69,11 +69,8 @@ static void signal_channel_destroyed(CHANNEL_REC *channel) /* kicked out from channel */ window_bind_add(window, channel->server->tag, channel->name); - } else if (settings_get_bool("autoclose_windows") && - (!channel->joined || channel->left) && - window->items == NULL && windows->next != NULL) { - window_destroy(window); - } + } else if (!channel->joined || channel->left) + window_auto_destroy(window); } static void signal_window_item_destroy(WINDOW_REC *window, WI_ITEM_REC *item) diff --git a/src/fe-common/core/fe-queries.c b/src/fe-common/core/fe-queries.c index 23606962..c1ffdc9b 100644 --- a/src/fe-common/core/fe-queries.c +++ b/src/fe-common/core/fe-queries.c @@ -83,9 +83,8 @@ static void signal_query_destroyed(QUERY_REC *query) if (window != NULL) { window_item_destroy((WI_ITEM_REC *) query); - if (window->items == NULL && windows->next != NULL && - !query->unwanted && settings_get_bool("autoclose_windows")) - window_destroy(window); + if (!query->unwanted) + window_auto_destroy(window); } } diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c index c0839470..9941c303 100644 --- a/src/fe-common/core/fe-windows.c +++ b/src/fe-common/core/fe-windows.c @@ -130,6 +130,13 @@ void window_destroy(WINDOW_REC *window) g_free(window); } +void window_auto_destroy(WINDOW_REC *window) +{ + if (settings_get_bool("autoclose_windows") && windows->next != NULL && + window->items == NULL && window->level == 0) + window_destroy(window); +} + void window_set_active(WINDOW_REC *window) { WINDOW_REC *old_window; diff --git a/src/fe-common/core/fe-windows.h b/src/fe-common/core/fe-windows.h index 62869a49..ed490bd5 100644 --- a/src/fe-common/core/fe-windows.h +++ b/src/fe-common/core/fe-windows.h @@ -59,6 +59,8 @@ extern WINDOW_REC *active_win; WINDOW_REC *window_create(WI_ITEM_REC *item, int automatic); void window_destroy(WINDOW_REC *window); +void window_auto_destroy(WINDOW_REC *window); + void window_set_active(WINDOW_REC *window); void window_change_server(WINDOW_REC *window, void *server); |