Revision: 39978
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39978
Author:   blendix
Date:     2011-09-06 17:18:50 +0000 (Tue, 06 Sep 2011)
Log Message:
-----------
Fix screen/scene browsing in info header not working right, mistake in code 
cleanup.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_screen.c
    trunk/blender/source/blender/makesrna/intern/rna_wm.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_screen.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_screen.c   2011-09-06 
16:51:10 UTC (rev 39977)
+++ trunk/blender/source/blender/makesrna/intern/rna_screen.c   2011-09-06 
17:18:50 UTC (rev 39978)
@@ -68,13 +68,14 @@
        sc->newscene= value.data;
 }
 
-static void rna_Screen_scene_update(Main *UNUSED(bmain), Scene *UNUSED(scene), 
PointerRNA *ptr)
+static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
 {
        bScreen *sc= (bScreen*)ptr->data;
 
-       /* exception: can't set screens inside of area/region handers */
+       /* exception: can't set screens inside of area/region handers, and must
+          use context so notifier gets to the right window  */
        if(sc->newscene) {
-               WM_main_add_notifier(NC_SCENE|ND_SCENEBROWSE, sc->newscene);
+               WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
                sc->newscene= NULL;
        }
 }
@@ -231,6 +232,7 @@
        RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", 
NULL, NULL);
        RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in 
the screen");
+       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
 
        /* collections */

Modified: trunk/blender/source/blender/makesrna/intern/rna_wm.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_wm.c       2011-09-06 
16:51:10 UTC (rev 39977)
+++ trunk/blender/source/blender/makesrna/intern/rna_wm.c       2011-09-06 
17:18:50 UTC (rev 39978)
@@ -482,13 +482,14 @@
        win->newscreen= value.data;
 }
 
-static void rna_Window_screen_update(Main *UNUSED(bmain), Scene 
*UNUSED(scene), PointerRNA *ptr)
+static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
 {
        wmWindow *win= (wmWindow*)ptr->data;
 
-       /* exception: can't set screens inside of area/region handers */
+       /* exception: can't set screens inside of area/region handers, and must
+          use context so notifier gets to the right window */
        if(win->newscreen) {
-               WM_main_add_notifier(NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
+               WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, 
win->newscreen);
                win->newscreen= NULL;
        }
 }
@@ -1454,6 +1455,7 @@
        RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the 
window");
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", 
NULL, NULL);
+       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, 0, "rna_Window_screen_update");
 }
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to