Merge branch 'master' into blender2.8
This commit is contained in:
@@ -2547,24 +2547,34 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
return action;
|
||||
|
||||
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
|
||||
if (event->check_drag) {
|
||||
|
||||
/* 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 ||
|
||||
(abs(event->y - win->eventstate->prevclicky)) >= U.tweak_threshold)
|
||||
{
|
||||
short val = event->val;
|
||||
short type = event->type;
|
||||
event->val = KM_CLICK_DRAG;
|
||||
event->type = win->eventstate->type;
|
||||
|
||||
CLOG_INFO(WM_LOG_HANDLERS, 1, "handling PRESS_DRAG");
|
||||
|
||||
action |= wm_handlers_do_intern(C, event, handlers);
|
||||
|
||||
event->val = val;
|
||||
event->type = type;
|
||||
|
||||
win->eventstate->check_click = 0;
|
||||
win->eventstate->check_drag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
if ((abs(event->x - win->eventstate->prevclickx)) >= U.tweak_threshold ||
|
||||
(abs(event->y - win->eventstate->prevclicky)) >= U.tweak_threshold)
|
||||
{
|
||||
short val = event->val;
|
||||
short type = event->type;
|
||||
event->val = KM_CLICK_DRAG;
|
||||
event->type = win->eventstate->type;
|
||||
|
||||
CLOG_INFO(WM_LOG_HANDLERS, 1, "handling PRESS_DRAG");
|
||||
|
||||
action |= wm_handlers_do_intern(C, event, handlers);
|
||||
|
||||
event->val = val;
|
||||
event->type = type;
|
||||
|
||||
win->eventstate->check_click = 0;
|
||||
if (win) {
|
||||
win->eventstate->check_drag = 0;
|
||||
}
|
||||
}
|
||||
@@ -2572,7 +2582,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
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);
|
||||
|
||||
@@ -2624,9 +2634,9 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user