diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-03 07:59:20 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-03 08:07:18 +0300 |
commit | 4d0f846b936c9101ecb76a6db962aac2d74a460a (patch) | |
tree | b8160f7a19bae8d8604efb7acee93d753a9051fd /source/blender/windowmanager | |
parent | 9d529407dae77efa552aad99fe3a38a78f70b41e (diff) |
Event System: use more thoroughly tested logic for click-drag events
No functional changes, largely restoring old logic & removing the need
for workarounds.
Reverts:
- 13b6cec039681db40e677463aa9fdff6d55896aa.
- aa71414dfca7f301e101cce3e72551e7529290ea (partially).
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 16 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture_ops.c | 7 |
2 files changed, 8 insertions, 15 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index af7d2a26e7e..b531467c52d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3191,11 +3191,15 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) copy_v2_v2_int(event->xy, prev_xy); win->event_queue_check_click = false; + if (!((action & WM_HANDLER_BREAK) == 0 || wm_action_not_handled(action))) { + /* Only disable when handled as other handlers may use this drag event. */ + win->event_queue_check_drag = false; + } } } - else { - win->event_queue_check_drag = false; - } + } + else { + win->event_queue_check_drag = false; } } else if (ISMOUSE_BUTTON(event->type) || ISKEYBOARD(event->type)) { @@ -3267,6 +3271,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) } else { win->event_queue_check_click = false; + win->event_queue_check_drag = false; } } else if (ISMOUSE_WHEEL(event->type) || ISMOUSE_GESTURE(event->type)) { @@ -3713,11 +3718,6 @@ void wm_event_do_handlers(bContext *C) /* Check dragging, creates new event or frees, adds draw tag. */ wm_event_drag_and_drop_test(wm, win, event); - /* Builtin drag: #KM_CLICK_DRAG. */ - if (action & WM_HANDLER_BREAK) { - win->event_queue_check_drag = false; - } - if ((action & WM_HANDLER_BREAK) == 0) { /* NOTE: setting subwin active should be done here, after modal handlers have been done. */ if (event->type == MOUSEMOVE) { diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c index ce924ef546c..1fdc8bbe2c8 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.c +++ b/source/blender/windowmanager/intern/wm_gesture_ops.c @@ -162,13 +162,6 @@ 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) && |