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>2018-10-25 08:06:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-25 08:06:47 +0300
commit6d49b623e2efce59b58bb1295024ab8ac492370a (patch)
treeebe29d04b2e9730dfb4f7cd733e63e2676794dfc /source/blender/editors/sculpt_paint/paint_cursor.c
parent46587b3ccb0ec842500ce2c3f2359b78550aad0f (diff)
WM: space, region type filtering for paint cursor
Avoids calling poll on mouse-move for unrelated space/region types.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 7d94e63e2bc..294981e7303 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -41,6 +41,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
@@ -1153,8 +1154,14 @@ void paint_cursor_start(bContext *C, bool (*poll)(bContext *C))
{
Paint *p = BKE_paint_get_active_from_context(C);
- if (p && !p->paint_cursor)
- p->paint_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), poll, paint_draw_cursor, NULL);
+ if (p && !p->paint_cursor) {
+ p->paint_cursor = WM_paint_cursor_activate(
+ CTX_wm_manager(C),
+ SPACE_TYPE_ANY, RGN_TYPE_ANY,
+ poll,
+ paint_draw_cursor,
+ NULL);
+ }
/* invalidate the paint cursors */
BKE_paint_invalidate_overlay_all();
@@ -1162,6 +1169,12 @@ void paint_cursor_start(bContext *C, bool (*poll)(bContext *C))
void paint_cursor_start_explicit(Paint *p, wmWindowManager *wm, bool (*poll)(bContext *C))
{
- if (p && !p->paint_cursor)
- p->paint_cursor = WM_paint_cursor_activate(wm, poll, paint_draw_cursor, NULL);
+ if (p && !p->paint_cursor) {
+ p->paint_cursor = WM_paint_cursor_activate(
+ wm,
+ SPACE_TYPE_ANY, RGN_TYPE_ANY,
+ poll,
+ paint_draw_cursor,
+ NULL);
+ }
}