diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-02 03:32:57 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-02 03:32:57 +0400 |
commit | b26ef33b8ed68ba3b5a5a78a3f23fcade4035f31 (patch) | |
tree | dd88daaab4ad1768e6060e6f787741959cfc3c04 /source/blender/editors/screen/area.c | |
parent | bc942eceacb638735dc4f4f68252c4c207147a70 (diff) |
Fix #19311: adding/opening datablocks did not always make the right
one active. Now there's a function to get the pointer + property from
the UI, just like for the animation operators.
Also two fixes for fileselect events, regions are now preserved so that
context is restored to the old region, and the cancel callback is called
when the operator is cancelled.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 87901d75494..fb782837d5e 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -958,17 +958,22 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space) /* Note; SPACE_EMPTY is possible on new screens */ /* regions */ - if(swap_space<2) { - st= BKE_spacetype_from_id(sa1->spacetype); - for(ar= sa1->regionbase.first; ar; ar= ar->next) - BKE_area_region_free(st, ar); - BLI_freelistN(&sa1->regionbase); + if(swap_space == 1) { + SWAP(ListBase, sa1->regionbase, sa2->regionbase); } - - st= BKE_spacetype_from_id(sa2->spacetype); - for(ar= sa2->regionbase.first; ar; ar= ar->next) { - ARegion *newar= BKE_area_region_copy(st, ar); - BLI_addtail(&sa1->regionbase, newar); + else { + if(swap_space<2) { + st= BKE_spacetype_from_id(sa1->spacetype); + for(ar= sa1->regionbase.first; ar; ar= ar->next) + BKE_area_region_free(st, ar); + BLI_freelistN(&sa1->regionbase); + } + + st= BKE_spacetype_from_id(sa2->spacetype); + for(ar= sa2->regionbase.first; ar; ar= ar->next) { + ARegion *newar= BKE_area_region_copy(st, ar); + BLI_addtail(&sa1->regionbase, newar); + } } } |