Page MenuHome

Fix T83888: Ctrl F in Asset Browser crashes blender
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 17 2020, 1:42 PM.

Details

Summary

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" is found.

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 17 2020, 1:42 PM
Julian Eisel (Severin) requested changes to this revision.Dec 17 2020, 1:56 PM

I don't like that the current code makes assumptions about where the button is. That could change and then the operator would break. So I'd suggest iterating over all regions and stopping when UI_textbutton_activate_rna() exists successfully.
This might not work as expected if the button is shown in multiple regions, but a) that's a purely theoretical corner case currently and b) if somebody decides to do this it is a problem they'd have to be aware of either way.

This revision now requires changes to proceed.Dec 17 2020, 1:56 PM

iterate all regions (instead of only checking UI and HEADER)

This revision is now accepted and ready to land.Dec 17 2020, 2:23 PM