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
parent e1cc9aa7f2
commit ee64b595da
Notes: blender-bot 2023-03-24 17:05:22 +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

@ -8474,7 +8474,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);
@ -8488,10 +8492,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

@ -2726,7 +2726,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;
}