[Bf-blender-cvs] [fed995ced5b] master: Fix T83888: Ctrl F in Asset Browser crashes blender

Philipp Oeser noreply at git.blender.org
Thu Dec 17 16:06:33 CET 2020


Commit: fed995ced5b0b963bb42de5aa3e93a3c5dc91aac
Author: Philipp Oeser
Date:   Thu Dec 17 13:41:10 2020 +0100
Branches: master
https://developer.blender.org/rBfed995ced5b0b963bb42de5aa3e93a3c5dc91aac

Fix T83888: Ctrl F in Asset Browser crashes blender

In case of being in Asset browsing mode, the search field is located in
the header (RGN_TYPE_HEADER not RGN_TYPE_UI as for file browsing mode).
To be future proof, now iterate all regions and act if the
"filter_search" can be activated.

Maniphest Tasks: T83888

Differential Revision: https://developer.blender.org/D9882

===================================================================

M	source/blender/editors/space_file/file_ops.c

===================================================================

diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index be4577bcba7..3730174a6c7 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2778,13 +2778,20 @@ void FILE_OT_delete(struct wmOperatorType *ot)
 static int file_start_filter_exec(bContext *C, wmOperator *UNUSED(op))
 {
   ScrArea *area = CTX_wm_area(C);
-  ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_UI);
   SpaceFile *sfile = CTX_wm_space_file(C);
   FileSelectParams *params = ED_fileselect_get_active_params(sfile);
 
   ARegion *region_ctx = CTX_wm_region(C);
-  CTX_wm_region_set(C, region);
-  UI_textbutton_activate_rna(C, region, params, "filter_search");
+
+  if (area) {
+    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+      CTX_wm_region_set(C, region);
+      if (UI_textbutton_activate_rna(C, region, params, "filter_search")) {
+        break;
+      }
+    }
+  }
+
   CTX_wm_region_set(C, region_ctx);
 
   return OPERATOR_FINISHED;



More information about the Bf-blender-cvs mailing list