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:
authorMike Erwin <significant.bit@gmail.com>2011-07-25 04:03:07 +0400
committerMike Erwin <significant.bit@gmail.com>2011-07-25 04:03:07 +0400
commit73417bfbb564a2e5b1b203e436994ea8b7f3c535 (patch)
tree3ab633e6397cb7396ab24a5730d8a4204fc18c9e /source/blender
parentabf658d36785e3fb0fe458ba7ee9b22987a9c036 (diff)
spoof MOUSEMOVE after NDOF_MOTION event, added comments
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c13
2 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index bddb30a4262..09873566d4a 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -832,6 +832,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
float mouse[2];
int first= 0;
+ // let NDOF motion pass through to the 3D view so we can paint and rotate simultaneously!
+ // this isn't perfect... even when an extra MOUSEMOVE is spoofed, the stroke discards it
+ // since the 2D deltas are zero -- code in this file needs to be updated to use the
+ // post-NDOF_MOTION MOUSEMOVE
if (event->type == NDOF_MOTION)
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ad8df1ef0bb..322cd3b5642 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1815,7 +1815,10 @@ void wm_event_do_handlers(bContext *C)
/* for regions having custom cursors */
wm_paintcursor_test(C, event);
}
-
+ else if (event->type==NDOF_MOTION) {
+ win->addmousemove = TRUE;
+ }
+
for(sa= win->screen->areabase.first; sa; sa= sa->next) {
if(wm_event_inside_i(event, &sa->totrct)) {
CTX_wm_area_set(C, sa);
@@ -1879,7 +1882,10 @@ void wm_event_do_handlers(bContext *C)
if(doit && win->screen && win->screen->subwinactive != win->screen->mainwin) {
win->eventstate->prevx= event->x;
win->eventstate->prevy= event->y;
+ //printf("win->eventstate->prev = %d %d\n", event->x, event->y);
}
+ else
+ ;//printf("not setting prev to %d %d\n", event->x, event->y);
}
/* store last event for this window */
@@ -1922,6 +1928,7 @@ void wm_event_do_handlers(bContext *C)
/* only add mousemove when queue was read entirely */
if(win->addmousemove && win->eventstate) {
wmEvent tevent= *(win->eventstate);
+ //printf("adding MOUSEMOVE %d %d\n", tevent.x, tevent.y);
tevent.type= MOUSEMOVE;
tevent.prevx= tevent.x;
tevent.prevy= tevent.y;
@@ -2408,6 +2415,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
update_tablet_data(win, &event);
wm_event_add(win, &event);
+
+ //printf("sending MOUSEMOVE %d %d\n", event.x, event.y);
/* also add to other window if event is there, this makes overdraws disappear nicely */
/* it remaps mousecoord to other window in event */
@@ -2586,6 +2595,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
attach_ndof_data(&event, customdata);
wm_event_add(win, &event);
+ //printf("sending NDOF_MOTION, prev = %d %d\n", event.x, event.y);
+
break;
}