[Bf-blender-cvs] [7784cf30eb3] master: WM: move WM_event_is_last_mousemove to the WM API

Campbell Barton noreply at git.blender.org
Tue Jul 18 09:58:34 CEST 2017


Commit: 7784cf30eb32b7ad022735012bdbb82b96b81ab3
Author: Campbell Barton
Date:   Tue Jul 18 18:06:21 2017 +1000
Branches: master
https://developer.blender.org/rB7784cf30eb32b7ad022735012bdbb82b96b81ab3

WM: move WM_event_is_last_mousemove to the WM API

===================================================================

M	source/blender/editors/space_view3d/view3d_walk.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index 542dc410bc3..c6b73056a9a 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -674,16 +674,6 @@ static int walkEnd(bContext *C, WalkInfo *walk)
 	return OPERATOR_CANCELLED;
 }
 
-static bool wm_event_is_last_mousemove(const wmEvent *event)
-{
-	while ((event = event->next)) {
-		if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
-			return false;
-		}
-	}
-	return true;
-}
-
 static void walkEvent(bContext *C, wmOperator *op, WalkInfo *walk, const wmEvent *event)
 {
 	if (event->type == TIMER && event->customdata == walk->timer) {
@@ -736,7 +726,7 @@ static void walkEvent(bContext *C, wmOperator *op, WalkInfo *walk, const wmEvent
 			}
 			else
 #endif
-			if (wm_event_is_last_mousemove(event)) {
+			if (WM_event_is_last_mousemove(event)) {
 				wmWindow *win = CTX_wm_window(C);
 
 #ifdef __APPLE__
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 60a39b24208..461ed48efc1 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -189,6 +189,7 @@ struct wmEventHandler *WM_event_add_dropbox_handler(ListBase *handlers, ListBase
 void		WM_event_add_mousemove(struct bContext *C);
 bool        WM_modal_tweak_exit(const struct wmEvent *event, int tweak_event);
 bool		WM_event_is_absolute(const struct wmEvent *event);
+bool		WM_event_is_last_mousemove(const struct wmEvent *event);
 
 #ifdef WITH_INPUT_NDOF
 			/* 3D mouse */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index f26ee0e73ec..6e14d3c03e5 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -615,6 +615,16 @@ bool WM_event_is_absolute(const wmEvent *event)
 	return (event->tablet_data != NULL);
 }
 
+bool WM_event_is_last_mousemove(const wmEvent *event)
+{
+	while ((event = event->next)) {
+		if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
+			return false;
+		}
+	}
+	return true;
+}
+
 #ifdef WITH_INPUT_NDOF
 void WM_ndof_deadzone_set(float deadzone)
 {




More information about the Bf-blender-cvs mailing list