From 11160fe1a081b603fe3ac28e8e5acb81a299f55d Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Mon, 13 Nov 2023 12:34:59 +0530 Subject: [PATCH] Fix #114758: keep text field empty for global search Revert cea02c15f810beba5dd65a300a6389ccc29970ad. This will fix the issue mentioned in #114758 and it will also allow user to see the recent searches in the list below the search box. --- source/blender/windowmanager/intern/wm_operators.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index cc8bcdf7b99..195660a3340 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -1856,8 +1856,6 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *eve } static SearchPopupInit_Data data{}; - char temp_buffer[256] = ""; - STRNCPY(temp_buffer, g_search_text); if (search_type == SEARCH_TYPE_SINGLE_MENU) { { @@ -1871,6 +1869,9 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *eve MEM_SAFE_FREE(buffer); } } + else { + g_search_text[0] = '\0'; + } data.search_type = search_type; data.size[0] = UI_searchbox_size_x() * 2; @@ -1878,10 +1879,6 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *eve UI_popup_block_invoke_ex(C, wm_block_search_menu, &data, nullptr, false); - /* g_search_text contains pressed letter here, copy previous searched - * value back to it, this will retain last searched result. see: #112896 */ - STRNCPY(g_search_text, temp_buffer); - return OPERATOR_INTERFACE; } -- 2.30.2