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:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_cursors.c')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 24ec3aef759..eaeaac45f89 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -42,6 +42,7 @@
#include "DNA_listBase.h"
#include "DNA_userdef_types.h"
+#include "DNA_workspace_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -156,6 +157,23 @@ void WM_cursor_set(wmWindow *win, int curs)
}
}
+bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *sa, const ARegion *ar)
+{
+ if (ar && (ar->regiontype != RGN_TYPE_WINDOW)) {
+ return false;
+ }
+
+ bToolRef_Runtime *tref_rt = (sa && sa->runtime.tool) ? sa->runtime.tool->runtime : NULL;
+ if (tref_rt && tref_rt->cursor != CURSOR_STD) {
+ if (win->modalcursor == 0) {
+ WM_cursor_set(win, tref_rt->cursor);
+ win->cursor = tref_rt->cursor;
+ return true;
+ }
+ }
+ return false;
+}
+
void WM_cursor_modal_set(wmWindow *win, int val)
{
if (win->lastcursor == 0)