diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-12-27 19:08:00 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-12-27 19:08:00 +0300 |
commit | 7dee0bbf066108dca64e9df5cb3da24f40ef0989 (patch) | |
tree | 93c1d7ab20bf7897c2d45e4b5f0c34af1456c8c8 /source/blender/editors/space_buttons | |
parent | 110373de6a52a20eb759aea9a11e4c45fcdb619b (diff) |
Fix missing redraws when changing active view-layer or its name
Also removed unnecessary `struct` keywords.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 878feb81e8a..179780bf517 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -226,11 +226,12 @@ static void buttons_header_region_draw(const bContext *C, ARegion *ar) } static void buttons_header_region_message_subscribe( - const struct bContext *UNUSED(C), - struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), - struct bScreen *UNUSED(screen), struct ScrArea *UNUSED(sa), struct ARegion *ar, + const bContext *UNUSED(C), + WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), + bScreen *UNUSED(screen), ScrArea *sa, ARegion *ar, struct wmMsgBus *mbus) { + SpaceButs *sbuts = sa->spacedata.first; wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = ar, .user_data = ar, @@ -240,6 +241,10 @@ static void buttons_header_region_message_subscribe( /* Don't check for SpaceButs.mainb here, we may toggle between view-layers * where one has no active object, so that available contexts changes. */ WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); + + if (!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_WORLD)) { + WM_msg_subscribe_rna_anon_prop(mbus, ViewLayer, name, &msg_sub_value_region_tag_redraw); + } } /* draw a certain button set only if properties area is currently |