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.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 58ca3bf1b95..2af68956923 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -145,6 +145,16 @@ void WM_cursor_set(wmWindow *win, int curs)
return; /* Can't set custom cursor before Window init */
}
+ if (curs == WM_CURSOR_DEFAULT && win->modalcursor) {
+ curs = win->modalcursor;
+ }
+
+ if (win->cursor == curs) {
+ return; /* Cursor is already set */
+ }
+
+ win->cursor = curs;
+
if (curs == WM_CURSOR_NONE) {
GHOST_SetCursorVisibility(win->ghostwin, 0);
return;
@@ -152,12 +162,6 @@ void WM_cursor_set(wmWindow *win, int curs)
GHOST_SetCursorVisibility(win->ghostwin, 1);
- if (curs == WM_CURSOR_DEFAULT && win->modalcursor) {
- curs = win->modalcursor;
- }
-
- win->cursor = curs;
-
if (curs < 0 || curs >= WM_CURSOR_NUM) {
BLI_assert(!"Invalid cursor number");
return;