fix [#35468] screen list shows temp layout

This commit is contained in:
Campbell Barton 2013-06-03 04:06:54 +00:00
parent f658124ca5
commit 8a1ef33e88

@ -585,6 +585,14 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
win->newscreen = value.data; win->newscreen = value.data;
} }
int rna_Window_screen_assign_poll(PointerRNA *ptr, PointerRNA value)
{
bScreen *screen = (bScreen *)value.id.data;
return !screen->temp;
}
static void rna_Window_screen_update(bContext *C, PointerRNA *ptr) static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
{ {
wmWindow *win = (wmWindow *)ptr->data; wmWindow *win = (wmWindow *)ptr->data;
@ -1706,7 +1714,7 @@ static void rna_def_window(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Screen"); RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window"); RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, "rna_Window_screen_assign_poll");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Window_screen_update"); RNA_def_property_update(prop, 0, "rna_Window_screen_update");