From c488c3e58b0ead6071516dc7d396dfdd0c9481ce Mon Sep 17 00:00:00 2001 From: Jase Thew Date: Sun, 31 Oct 2010 19:40:03 +0000 Subject: [PATCH] Set window binds for channel items as sticky when re-creating window binds as part of /layout save. This addresses the problem of previously saved channel window items forgetting their windows upon reconnection, which resulted in them being opened in new windows. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5194 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/windows-layout.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fe-common/core/windows-layout.c b/src/fe-common/core/windows-layout.c index d6a462cf..e5fe6bf6 100644 --- a/src/fe-common/core/windows-layout.c +++ b/src/fe-common/core/windows-layout.c @@ -152,6 +152,7 @@ static void sig_layout_save_item(WINDOW_REC *window, WI_ITEM_REC *item, CONFIG_NODE *subnode; CHAT_PROTOCOL_REC *proto; const char *type; + WINDOW_BIND_REC *rec; type = module_find_id_str("WINDOW ITEM TYPE", item->type); if (type == NULL) @@ -168,8 +169,11 @@ static void sig_layout_save_item(WINDOW_REC *window, WI_ITEM_REC *item, if (item->server != NULL) { iconfig_node_set_str(subnode, "tag", item->server->tag); - if (IS_CHANNEL(item)) - window_bind_add(window, item->server->tag, item->visible_name); + if (IS_CHANNEL(item)) { + rec = window_bind_add(window, item->server->tag, item->visible_name); + if (rec != NULL) + rec->sticky = TRUE; + } } else if (IS_QUERY(item)) { iconfig_node_set_str(subnode, "tag", QUERY(item)->server_tag); }