From 074e6cf768b9c153b64a916b4b2d332d8ba6bef4 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Mon, 17 Sep 2018 14:26:25 +0000 Subject: [PATCH] fe-text: only save non-default window hidelevel This will only save the window hidelevel in the layout if it differs from window_default_hidelevel. --- src/fe-text/mainwindows-layout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fe-text/mainwindows-layout.c b/src/fe-text/mainwindows-layout.c index 17c6647b..b937dffe 100644 --- a/src/fe-text/mainwindows-layout.c +++ b/src/fe-text/mainwindows-layout.c @@ -42,7 +42,7 @@ static void sig_layout_window_save(WINDOW_REC *window, CONFIG_NODE *node) iconfig_node_set_int(node, "parent", active->refnum); } - if (gui->view->hidden_level != MSGLEVEL_HIDDEN) { + if (gui->view->hidden_level != settings_get_level("window_default_hidelevel")) { char *level = bits2level(gui->view->hidden_level); iconfig_node_set_str(node, "hidelevel", level); g_free(level); @@ -56,6 +56,7 @@ static void sig_layout_window_restore(WINDOW_REC *window, CONFIG_NODE *node) { WINDOW_REC *parent; GUI_WINDOW_REC *gui; + char *default_hidelevel = settings_get_str("window_default_hidelevel"); gui = WINDOW_GUI(window); @@ -66,7 +67,7 @@ static void sig_layout_window_restore(WINDOW_REC *window, CONFIG_NODE *node) if (config_node_get_bool(node, "sticky", FALSE)) gui_window_set_sticky(window); - textbuffer_view_set_hidden_level(gui->view, level2bits(config_node_get_str(node, "hidelevel", "HIDDEN"), NULL)); + textbuffer_view_set_hidden_level(gui->view, level2bits(config_node_get_str(node, "hidelevel", default_hidelevel), NULL)); if (config_node_get_str(node, "scroll", NULL) != NULL) { gui->use_scroll = TRUE;