diff options
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 10 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4ede89e1620..64fdbbdd773 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1507,6 +1507,16 @@ void ED_region_init(bContext *C, ARegion *ar) region_update_rect(ar); } +void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *ar) +{ + if (ar->type && ar->type->cursor) { + ar->type->cursor(win, sa, ar); + } + else { + WM_cursor_set(win, CURSOR_STD); + } +} + /* for quick toggle, can skip fades */ void region_toggle_hidden(bContext *C, ARegion *ar, const bool do_fade) { diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 21d257ea161..23c6aa37a83 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1064,17 +1064,11 @@ bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc) /* screen sets cursor based on swinid */ static void region_cursor_set(wmWindow *win, int swinid, int swin_changed) { - ScrArea *sa = win->screen->areabase.first; - - for (; sa; sa = sa->next) { - ARegion *ar = sa->regionbase.first; - for (; ar; ar = ar->next) { + for (ScrArea *sa = win->screen->areabase.first; sa; sa = sa->next) { + for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { if (ar->swinid == swinid) { if (swin_changed || (ar->type && ar->type->event_cursor)) { - if (ar->type && ar->type->cursor) - ar->type->cursor(win, sa, ar); - else - WM_cursor_set(win, CURSOR_STD); + ED_region_cursor_set(win, sa, ar); } return; } |