diff options
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 1 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 1 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_event_types.h | 1 |
6 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e06722c1af1..b52297a319c 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1481,6 +1481,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* moving mouse - assumed that mouse button is down if in painting status */ case MOUSEMOVE: + case INBETWEEN_MOUSEMOVE: /* check if we're currently painting */ if (p->status == GP_STATUS_PAINTING) { /* handle drawing event */ diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 64f00caf479..6269b9c5e09 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4872,6 +4872,7 @@ static int paint_modal(bContext *C, wmOperator *op, wmEvent *event) paint_exit(C, op); return OPERATOR_FINISHED; case MOUSEMOVE: + case INBETWEEN_MOUSEMOVE: paint_apply_event(C, op, event); break; case TIMER: diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 03454a305ba..441464c5743 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -275,7 +275,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) MEM_freeN(stroke); return OPERATOR_FINISHED; } - else if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) { + else if(first || ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (event->type == TIMER && (event->customdata == stroke->timer))) { if(stroke->stroke_started) { if(paint_smooth_stroke(stroke, mouse, event)) { if(paint_space_stroke_enabled(stroke->brush)) { diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 52c18b4e581..1797df2abf0 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -114,6 +114,7 @@ EnumPropertyItem event_type_items[] = { {SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""}, {0, "", 0, NULL, NULL}, {MOUSEMOVE, "MOUSEMOVE", 0, "Mouse Move", ""}, + {INBETWEEN_MOUSEMOVE, "INBETWEEN_MOUSEMOVE", 0, "Inbetween Move", ""}, {MOUSEPAN, "TRACKPADPAN", 0, "Mouse/Trackpad Pan", ""}, {MOUSEZOOM, "TRACKPADZOOM", 0, "Mouse/Trackpad Zoom", ""}, {MOUSEROTATE, "MOUSEROTATE", 0, "Mouse/Trackpad Rotate", ""}, diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 70e804758b2..330244e910e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1614,7 +1614,7 @@ void wm_event_do_handlers(bContext *C) while( (event= win->queue.first) ) { int action = WM_HANDLER_CONTINUE; - if((G.f & G_DEBUG) && event && event->type!=MOUSEMOVE) + if((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) printf("pass on evt %d val %d\n", event->type, event->val); wm_eventemulation(event); @@ -2138,6 +2138,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int t case GHOST_kEventCursorMove: { if(win->active) { GHOST_TEventCursorData *cd= customdata; + wmEvent *lastevent= win->queue.last; #if defined(__APPLE__) && defined(GHOST_COCOA) //Cocoa already uses coordinates with y=0 at bottom, and returns inwindow coordinates on mouse moved event @@ -2156,6 +2157,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int t event.type= MOUSEMOVE; + /* some painting operators want accurate mouse events, they can + handle inbetween mouse move moves, others can happily ignore + them for better performance */ + if(lastevent && lastevent->type == MOUSEMOVE) + lastevent->type = INBETWEEN_MOUSEMOVE; + update_tablet_data(win, &event); wm_event_add(win, &event); diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index a93214e9a54..6cb3971bd21 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -70,6 +70,7 @@ /* mapped with userdef */ #define WHEELINMOUSE 0x00c #define WHEELOUTMOUSE 0x00d +#define INBETWEEN_MOUSEMOVE 0x011 /* SYSTEM : 0x01xx */ |