[Bf-blender-cvs] [13b6cec0396] master: Fix/Workaround T96120: Crash dropping from the file browser

Campbell Barton noreply at git.blender.org
Wed Mar 2 15:37:27 CET 2022


Commit: 13b6cec039681db40e677463aa9fdff6d55896aa
Author: Campbell Barton
Date:   Thu Mar 3 01:26:51 2022 +1100
Branches: master
https://developer.blender.org/rB13b6cec039681db40e677463aa9fdff6d55896aa

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.

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

M	source/blender/windowmanager/intern/wm_gesture_ops.c

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

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) &&



More information about the Bf-blender-cvs mailing list