diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-09 18:07:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-09 18:18:17 +0300 |
commit | ee64b595da5ed5b40b91e181bdbb179131d9ae0d (patch) | |
tree | 6c20af61f22f8e63b304c56b6d47c04ff85b80de | |
parent | e1cc9aa7f2813004cad34a580e2faa1b7ca21db1 (diff) |
Fix T77504: Operator search gives wrong results
Regression in e8ab0137f8766
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index eb99d044e17..4b0376a9c39 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -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); } /** diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 41d32fda088..6552dfc18f3 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -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; } |