Fix T77504: Operator search gives wrong results

Regression in e8ab0137f8
This commit is contained in:
Campbell Barton 2020-06-10 01:07:49 +10:00 committed by Jeroen Bakker
parent c26cd6e996
commit ce11640eef
Notes: blender-bot 2023-02-14 19:45:25 +01:00
Referenced by issue #77504, Operator Search gives the wrong result
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
2 changed files with 9 additions and 4 deletions

View File

@ -8413,7 +8413,11 @@ static int ui_handle_button_over(bContext *C, const wmEvent *event, ARegion *reg
return WM_UI_HANDLER_CONTINUE;
}
/* exported to interface.c: UI_but_active_only() */
/**
* Exported to interface.c: #UI_but_active_only()
* \note The region is only for the button.
* The context needs to be set by the caller.
*/
void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
{
wmWindow *win = CTX_wm_window(C);
@ -8427,10 +8431,7 @@ void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
event.customdata = but;
event.customdatafree = false;
ARegion *region_ctx = CTX_wm_region(C);
CTX_wm_region_set(C, region);
ui_do_button(C, but->block, but, &event);
CTX_wm_region_set(C, region_ctx);
}
/**

View File

@ -2712,7 +2712,11 @@ static int file_start_filter_exec(bContext *C, wmOperator *UNUSED(op))
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_UI);
SpaceFile *sf = CTX_wm_space_file(C);
ARegion *region_ctx = CTX_wm_region(C);
CTX_wm_region_set(C, region);
UI_textbutton_activate_rna(C, region, sf->params, "filter_search");
CTX_wm_region_set(C, region_ctx);
return OPERATOR_FINISHED;
}