diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-15 20:12:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-15 20:12:44 +0300 |
commit | 2291ce9f1f59d10a10badf77c3b1ff75dddc8336 (patch) | |
tree | 640198a59254f578dc0a23e78b455a3dd1f1ddc7 /source/blender/windowmanager | |
parent | ecc57e7524bf04d498646715dcf4f9340ef3fc56 (diff) | |
parent | 2b9edbc98becb540f1f907b7c31d7971b1603079 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index cd56eac84d1..e700a17b1ca 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -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) { - 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"); + /* 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); + action |= wm_handlers_do_intern(C, event, handlers); - event->val = val; - event->type = type; + event->val = val; + event->type = type; - win->eventstate->check_click = 0; + win->eventstate->check_click = 0; + win->eventstate->check_drag = 0; + } + } + } + else { + wmWindow *win = CTX_wm_window(C); + 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; + } } } |