From 9eb265f4756dc5707ac45e820160e4cc929a679e Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Wed, 5 Apr 2017 16:09:39 -0700 Subject: [PATCH] Don't create query menu until after initial prompt. (see #3877) A resize in the prompt will trigger a redraw, but the data won't be loaded yet, displaying a blank screen instead of the previous menu. Once the query is done, the data is loaded, but the menu->redraw state has been changed by the resize. We could manually flag a redraw, but it makes more sense visually logically to just create the menu after the query and results are loaded. --- query.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/query.c b/query.c index b1f7043a..df141b1d 100644 --- a/query.c +++ b/query.c @@ -318,16 +318,6 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) char helpstr[LONG_STRING]; char title[STRING]; - snprintf (title, sizeof (title), _("Query")); /* FIXME */ - - menu = mutt_new_menu (MENU_QUERY); - menu->make_entry = query_entry; - menu->search = query_search; - menu->tag = query_tag; - menu->title = title; - menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_QUERY, QueryHelp); - mutt_push_current_menu (menu); - if (results == NULL) { /* Prompt for Query */ @@ -341,6 +331,14 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) { snprintf (title, sizeof (title), _("Query '%s'"), buf); + menu = mutt_new_menu (MENU_QUERY); + menu->make_entry = query_entry; + menu->search = query_search; + menu->tag = query_tag; + menu->title = title; + menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_QUERY, QueryHelp); + mutt_push_current_menu (menu); + /* count the number of results */ for (queryp = results; queryp; queryp = queryp->next) menu->max++; @@ -536,8 +534,8 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) free_query (&results); FREE (&QueryTable); - } - mutt_pop_current_menu (menu); - mutt_menuDestroy (&menu); + mutt_pop_current_menu (menu); + mutt_menuDestroy (&menu); + } } -- 2.40.0