From 7dee0bbf066108dca64e9df5cb3da24f40ef0989 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Wed, 27 Dec 2017 17:08:00 +0100 Subject: Fix missing redraws when changing active view-layer or its name Also removed unnecessary `struct` keywords. --- source/blender/editors/space_info/space_info.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/editors/space_info') diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 4f042364c63..b13152883c3 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -50,6 +50,9 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_message.h" + +#include "RNA_access.h" #include "UI_resources.h" #include "UI_interface.h" @@ -284,6 +287,22 @@ static void info_header_listener( } +static void info_header_region_message_subscribe( + const bContext *UNUSED(C), + WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), + bScreen *UNUSED(screen), ScrArea *UNUSED(sa), ARegion *ar, + struct wmMsgBus *mbus) +{ + wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { + .owner = ar, + .user_data = ar, + .notify = ED_region_do_msg_notify_tag_redraw, + }; + + WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); + WM_msg_subscribe_rna_anon_prop(mbus, ViewLayer, name, &msg_sub_value_region_tag_redraw); +} + static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) { struct RecentFile *recent; @@ -347,6 +366,7 @@ void ED_spacetype_info(void) art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER; art->listener = info_header_listener; + art->message_subscribe = info_header_region_message_subscribe; art->init = info_header_region_init; art->draw = info_header_region_draw; -- cgit v1.2.3