Event System: use more thoroughly tested logic for click-drag events
No functional changes, largely restoring old logic & removing the need for workarounds. Reverts: -13b6cec039
. -aa71414dfc
(partially).
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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) &&
|
||||
|
Reference in New Issue
Block a user