Fix manipulator hiding cursor

Manipulator highlight, then transform would hide the mouse cursor.
This commit is contained in:
Campbell Barton
2018-07-11 17:16:10 +02:00
parent ad03a06d3c
commit cbfe522bb3
2 changed files with 6 additions and 3 deletions

View File

@@ -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;
};

View File

@@ -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);
}
}