From 13b6cec039681db40e677463aa9fdff6d55896aa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Mar 2022 01:26:51 +1100 Subject: Fix/Workaround T96120: Crash dropping from the file browser Since removal of tweak events 4986f718482b061082936f1f6aa13929741093a2, 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. --- source/blender/windowmanager/intern/wm_gesture_ops.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c index 1fdc8bbe2c8..ce924ef546c 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.c +++ b/source/blender/windowmanager/intern/wm_gesture_ops.c @@ -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) && -- cgit v1.2.3