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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-11 18:16:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-11 18:18:44 +0300
commitcbfe522bb320cc98ebd30930c354fd4b31b2a753 (patch)
treef047a27b4955a827e039596415416940da340c10 /source
parentad03a06d3c46f7a1ddb81e5d2c1406457b8f4507 (diff)
Fix manipulator hiding cursor
Manipulator highlight, then transform would hide the mouse cursor.
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h2
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
index a131c6c5069..ecf4ffd2ac4 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
@@ -114,6 +114,8 @@ struct wmManipulatorMap {
/* cursor location at point of entering modal (see: WM_MANIPULATOR_GRAB_CURSOR) */
int event_xy[2];
short event_grabcursor;
+ /* until we have nice cursor push/pop API. */
+ int last_cursor;
} mmap_context;
};
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 7b06382b029..76668702bd1 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -861,17 +861,18 @@ bool wm_manipulatormap_highlight_set(
if (mpr) {
mpr->state |= WM_MANIPULATOR_STATE_HIGHLIGHT;
mpr->highlight_part = part;
+ mmap->mmap_context.last_cursor = -1;
if (C && mpr->type->cursor_get) {
wmWindow *win = CTX_wm_window(C);
- win->lastcursor = win->cursor;
+ mmap->mmap_context.last_cursor = win->cursor;
WM_cursor_set(win, mpr->type->cursor_get(mpr));
}
}
else {
- if (C) {
+ if (C && mmap->mmap_context.last_cursor != -1) {
wmWindow *win = CTX_wm_window(C);
- WM_cursor_set(win, win->lastcursor);
+ WM_cursor_set(win, mmap->mmap_context.last_cursor);
}
}