WM: move WM_event_is_last_mousemove to the WM API
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Jul 2017 08:06:21 +0000 (18:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Jul 2017 08:07:49 +0000 (18:07 +1000)
source/blender/editors/space_view3d/view3d_walk.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c

index 542dc410bc3faeb7a85cd1fd5184a170f18e9b6f..c6b73056a9a1cdfb7c3f830a436f517020d69e63 100644 (file)
@@ -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__
index 60a39b24208f1161753ce3d724d2afed8e0fd8d1..461ed48efc103c0950def6718012e986c28f6369 100644 (file)
@@ -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 */
index f26ee0e73ec7cf792ba4c6e836f28c1dea939f09..6e14d3c03e59427db0df13ac931e731b4bfdf5e8 100644 (file)
@@ -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)
 {