forked from bartvdbraak/blender
WM: suppress drag events if motion is handled
This commit is contained in:
parent
d645b1a78a
commit
2b9edbc98b
@ -2252,6 +2252,9 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
return action;
|
||||
|
||||
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
|
||||
|
||||
/* Test for CLICK_DRAG events. */
|
||||
if (wm_action_not_handled(action)) {
|
||||
if (event->check_drag) {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
if ((abs(event->x - win->eventstate->prevclickx)) >= U.tweak_threshold ||
|
||||
@ -2274,10 +2277,17 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
if (win) {
|
||||
win->eventstate->check_drag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ISMOUSE_BUTTON(event->type) || ISKEYBOARD(event->type)) {
|
||||
/* All events that don't set wmEvent.prevtype must be ignored. */
|
||||
|
||||
/* test for CLICK events */
|
||||
/* Test for CLICK events. */
|
||||
if (wm_action_not_handled(action)) {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
|
||||
@ -2329,11 +2339,11 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
}
|
||||
else {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
|
||||
if (win)
|
||||
if (win) {
|
||||
win->eventstate->check_click = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return action;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user