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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-01-23 17:27:59 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-01-23 17:35:20 +0400
commit26ae14d2dccd0d34edfe9f26a4126e9a69e74983 (patch)
tree0db615fc39b539de9ac28aa7bf6c735a56c6c729 /source/blender/makesrna/intern/rna_screen.c
parent64bd4be6b2d9d093c56e6cce809d8cd1650ebe6f (diff)
Fix crash when changing space type to 3D space when having multiple windows
it is possible that different windows shares scene but displays different layers. And it's also possible that different areas in the same window will show different layers. First case was violated in `dag_current_scene_layers()` which only checked scene layers only once and if multiple windows shares the same scene only one window was handled. Now made it so layers from all windows will be squashed together into a single `DagSceneLayer`. This mainly solves issue with `DAG_on_visible_update()` which didn't work reliable with multiple open windows. Second case required call of `DAG_on_visible_update()` when changing space are type. This commit slows things a bit actually because `dag_current_scene_layers()` is actually called on every main WM loop iteration. It is possible to speed some logic up perhaps. Not sure it's so much critical to do now because there are unlikely to be more than few windows open anyway. Will rather think of skipping all that flushing things if no objects are tagged for update actually.
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r--source/blender/makesrna/intern/rna_screen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 85d57811187..5f652601637 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -56,6 +56,7 @@ EnumPropertyItem region_type_items[] = {
#ifdef RNA_RUNTIME
#include "BKE_global.h"
+#include "BKE_depsgraph.h"
#include "UI_view2d.h"
@@ -141,6 +142,11 @@ static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
ED_area_newspace(C, sa, sa->butspacetype);
ED_area_tag_redraw(sa);
+ /* It is possible that new layers becomes visible. */
+ if (sa->spacetype == SPACE_VIEW3D) {
+ DAG_on_visible_update(CTX_data_main(C), FALSE);
+ }
+
CTX_wm_window_set(C, prevwin);
CTX_wm_area_set(C, prevsa);
CTX_wm_region_set(C, prevar);