Fix/Workaround T96120: Crash dropping from the file browser

Since removal of tweak events 4986f71848,
box-select is activating while dragging files.

As far as I can tell this used to work because of differences
int the order tweak / click-drag events are handled.

Apply a workaround since dragging files doesn't prevent other parts
of the UI from activated (it's possible to open menus for e.g),
this is something we will likely want to limit which would resolve
this bug too.
This commit is contained in:
Campbell Barton 2022-03-03 01:26:51 +11:00
parent 3a0df7d37b
commit 13b6cec039
Notes: blender-bot 2023-02-13 11:52:02 +01:00
Referenced by commit 4d0f846b93, Event System: use more thoroughly tested logic for click-drag events
1 changed files with 7 additions and 0 deletions

View File

@ -162,6 +162,13 @@ static bool gesture_box_apply(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
/* FIXME(@campbellbarton): This is a temporary workaround T96120. As events
* are handled while dragging we should resolve this in a more general way. */
wmWindowManager *wm = CTX_wm_manager(C);
if (wm->drags.first) {
return OPERATOR_PASS_THROUGH;
}
wmWindow *win = CTX_wm_window(C);
const ARegion *region = CTX_wm_region(C);
const bool wait_for_input = !WM_event_is_mouse_drag_or_press(event) &&