diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-05-25 15:41:45 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-05-25 15:43:48 +0300 |
commit | 14b51b3974218db29361990d51d70ded7bd0443a (patch) | |
tree | 2b893eb5c54ad9faec71be4934c8976ed6a6be8e /source/blender/editors/space_action | |
parent | dc26ef081b98f0c475ccf79935360cf9986e2a02 (diff) |
Fix T55197: Dopesheet filtering settings were not triggering refresh anymore due to messagebus crap
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 2a0be4eaf0d..febbcd03645 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -379,6 +379,41 @@ static void action_channel_region_listener( } } +static void saction_channel_region_message_subscribe( + const struct bContext *UNUSED(C), + struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), + struct bScreen *screen, struct ScrArea *sa, struct ARegion *ar, + struct wmMsgBus *mbus) +{ + PointerRNA ptr; + RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, sa->spacedata.first, &ptr); + + wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { + .owner = ar, + .user_data = ar, + .notify = ED_region_do_msg_notify_tag_redraw, + }; + + /* All dopesheet filter settings, etc. affect the drawing of this editor, + * so just whitelist the entire struct for updates + */ + { + wmMsgParams_RNA msg_key_params = {{{0}}}; + StructRNA *type_array[] = { + &RNA_DopeSheet, + }; + + for (int i = 0; i < ARRAY_SIZE(type_array); i++) { + msg_key_params.ptr.type = type_array[i]; + WM_msg_subscribe_rna_params( + mbus, + &msg_key_params, + &msg_sub_value_region_tag_redraw, + __func__); + } + } +} + static void action_main_region_listener( bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -472,6 +507,25 @@ static void saction_main_region_message_subscribe( WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__); } } + + /* All dopesheet filter settings, etc. affect the drawing of this editor, + * so just whitelist the entire struct for updates + */ + { + wmMsgParams_RNA msg_key_params = {{{0}}}; + StructRNA *type_array[] = { + &RNA_DopeSheet, + }; + + for (int i = 0; i < ARRAY_SIZE(type_array); i++) { + msg_key_params.ptr.type = type_array[i]; + WM_msg_subscribe_rna_params( + mbus, + &msg_key_params, + &msg_sub_value_region_tag_redraw, + __func__); + } + } } /* editor level listener */ @@ -835,6 +889,7 @@ void ED_spacetype_action(void) art->init = action_channel_region_init; art->draw = action_channel_region_draw; art->listener = action_channel_region_listener; + art->message_subscribe = saction_channel_region_message_subscribe; BLI_addhead(&st->regiontypes, art); |