Merge branch 'master' into blender2.8
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index b95eb099cce77b488b945669ce8a315262957b3d..be8e420e5706db0396cc98f704c224ee749031b6 100644 (file)
@@ -3910,9 +3910,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 
                        /* double click test - only for press */
                        if (event.val == KM_PRESS) {
-                               evt->prevclicktime = PIL_check_seconds_timer();
-                               evt->prevclickx = event.x;
-                               evt->prevclicky = event.y;
+                               /* Don't reset timer & location when holding the key generates repeat events. */
+                               if ((evt->prevtype != event.type) || (evt->prevval != KM_PRESS)) {
+                                       evt->prevclicktime = PIL_check_seconds_timer();
+                                       evt->prevclickx = event.x;
+                                       evt->prevclicky = event.y;
+                               }
                        }
 
                        wm_event_add(win, &event);