Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 20:19:39 +0000 (22:19 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 20:19:39 +0000 (22:19 +0200)
source/blender/windowmanager/intern/wm_event_system.c

index 37d594df688f6c38254d7721cc66e83c1dd42b1e..1e3a08bdcbc0e33a5af51ec51d9690ea28c88c44 100644 (file)
@@ -2549,7 +2549,9 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
                        }
                }
        }
-       else if (!ELEM(event->type, EVENT_NONE) && !ISTIMER(event->type)) {
+       else if (ISMOUSE(event->type) || ISKEYBOARD(event->type)) {
+               /* All events that don't set wmEvent.prevtype must be ignored. */
+
                /* test for CLICK events */
                if (wm_action_not_handled(action)) {
                        wmWindow *win = CTX_wm_window(C);
@@ -2559,11 +2561,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
 
                        if (win != NULL) {
                                if (event->val == KM_PRESS) {
-                                       /* Ensure the types match to prevent mouse wheel from triggering drag/clicks. */
-                                       if (event->type == win->eventstate->prevtype) {
-                                               win->eventstate->check_click = true;
-                                               win->eventstate->check_drag = true;
-                                       }
+                                       win->eventstate->check_click = true;
+                                       win->eventstate->check_drag = true;
                                }
                                else if (event->val == KM_RELEASE) {
                                        win->eventstate->check_drag = false;