Fix #114758: keep text field empty for global search #114774

Merged
Pratik Borhade merged 1 commits from PratikPB2123/blender:114758-f3-recent-search into main 2023-11-14 12:32:05 +01:00
1 changed files with 3 additions and 6 deletions

View File

@ -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;
}