diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-22 02:41:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-22 02:50:25 +0300 |
commit | 0b626703f99fb7146915f4be9e7013bae0c64c61 (patch) | |
tree | 77cb94ed9d019d25a36e9ec6278be58bfd0ad827 /source/blender/editors/screen/area.c | |
parent | 3e777653620a9261c35319fae64b3aa0eb83cdd4 (diff) |
Cleanup: internal changes to cursor resetting
- Move gizmo cursor check into ED_region_cursor_set so the result of
calling this function is the same as flagging for cursor update.
- Use tagging in ui_popup_block_remove which avoids adding a
mouse-move event in case the cursor needs to be changed again.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index c9e6cd24ac0..26240482e6d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1869,15 +1869,21 @@ void ED_region_floating_initialize(ARegion *ar) void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *ar) { - if (ar && sa && ar->type && ar->type->cursor) { - ar->type->cursor(win, sa, ar); - } - else { - if (WM_cursor_set_from_tool(win, sa, ar)) { + if (ar != NULL) { + if ((ar->gizmo_map != NULL) && WM_gizmomap_cursor_set(ar->gizmo_map, win)) { + return; + } + if (sa && ar->type && ar->type->cursor) { + ar->type->cursor(win, sa, ar); return; } - WM_cursor_set(win, WM_CURSOR_DEFAULT); } + + if (WM_cursor_set_from_tool(win, sa, ar)) { + return; + } + + WM_cursor_set(win, WM_CURSOR_DEFAULT); } /* for use after changing visibility of regions */ |