Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-11 17:30:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-11 17:30:16 +0400
commit1a0c5eb83aaaf18cef25d6d36a2c857c1381516c (patch)
tree46e522553626982f2b06104a7d7dfdbc9097fcab /source/blender/windowmanager/intern/wm_event_system.c
parent1bfa64895e0321460d5137e0db2df5fb83a22be7 (diff)
Events: Use INBETWEEN_MOUSEMOVE for inactive windows too.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 2233827b24b..ef9b7c4f1b0 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2913,6 +2913,19 @@ static bool wm_event_is_double_click(wmEvent *event, wmEvent *event_state)
return false;
}
+static void wm_event_add_mousemove(wmWindow *win, const wmEvent *event)
+{
+ wmEvent *event_last = win->queue.last;
+
+ /* some painting operators want accurate mouse events, they can
+ * handle in between mouse move moves, others can happily ignore
+ * them for better performance */
+ if (event_last && event_last->type == MOUSEMOVE)
+ event_last->type = INBETWEEN_MOUSEMOVE;
+
+ wm_event_add(win, event);
+}
+
/* windows store own event queues, no bContext here */
/* time is in 1000s of seconds, from ghost */
void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int UNUSED(time), void *customdata)
@@ -2928,7 +2941,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
case GHOST_kEventCursorMove:
{
GHOST_TEventCursorData *cd = customdata;
- wmEvent *lastevent = win->queue.last;
evt->x = cd->x;
evt->y = cd->y;
@@ -2937,14 +2949,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.y = evt->y;
event.type = MOUSEMOVE;
-
- /* some painting operators want accurate mouse events, they can
- * handle in between mouse move moves, others can happily ignore
- * them for better performance */
- if (lastevent && lastevent->type == MOUSEMOVE)
- lastevent->type = INBETWEEN_MOUSEMOVE;
-
- wm_event_add(win, &event);
+ wm_event_add_mousemove(win, &event);
/* also add to other window if event is there, this makes overdraws disappear nicely */
/* it remaps mousecoord to other window in event */
@@ -2955,8 +2960,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
oevent.x = owin->eventstate->x = event.x;
oevent.y = owin->eventstate->y = event.y;
oevent.type = MOUSEMOVE;
-
- wm_event_add(owin, &oevent);
+ wm_event_add_mousemove(owin, &oevent);
}
break;