diff options
Diffstat (limited to 'source/blender/editors/screen/screen_edit.c')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 1c068fdd6e4..02b1e002d86 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -574,6 +574,17 @@ bool screen_area_close(struct bContext *C, bScreen *screen, ScrArea *area) return screen_area_join_ex(C, screen, sa2, area, true); } +void screen_area_spacelink_add(Scene *scene, ScrArea *area, eSpace_Type space_type) +{ + SpaceType *stype = BKE_spacetype_from_id(space_type); + SpaceLink *slink = stype->create(area, scene); + + area->regionbase = slink->regionbase; + + BLI_addhead(&area->spacedata, slink); + BLI_listbase_clear(&slink->regionbase); +} + /* ****************** EXPORTED API TO OTHER MODULES *************************** */ /* screen sets cursor based on active region */ @@ -1023,13 +1034,7 @@ static void screen_global_area_refresh(wmWindow *win, } else { area = screen_area_create_with_geometry(&win->global_areas, rect, space_type); - SpaceType *stype = BKE_spacetype_from_id(space_type); - SpaceLink *slink = stype->create(area, WM_window_get_active_scene(win)); - - area->regionbase = slink->regionbase; - - BLI_addhead(&area->spacedata, slink); - BLI_listbase_clear(&slink->regionbase); + screen_area_spacelink_add(WM_window_get_active_scene(win), area, space_type); /* Data specific to global areas. */ area->global = MEM_callocN(sizeof(*area->global), __func__); |