From 9fc5a0c95eb9f68cb63fbdc8cf6451c152dcb820 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 22 May 2018 09:41:41 +0200 Subject: [PATCH] Fix area tool getting out of sync w/ active tool --- source/blender/windowmanager/intern/wm_toolsystem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 3ef5882bc03..2c81d28e61f 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -57,6 +57,8 @@ static void toolsystem_reinit_with_toolref( bContext *C, WorkSpace *UNUSED(workspace), bToolRef *tref); static void toolsystem_reinit_ensure_toolref( bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *default_tool); +static void toolsystem_refresh_screen_from_active_tool( + Main *bmain, WorkSpace *workspace, bToolRef *tref); /* -------------------------------------------------------------------- */ /** \name Tool Reference API @@ -278,6 +280,8 @@ void WM_toolsystem_ref_set_from_runtime( struct bContext *C, struct WorkSpace *workspace, bToolRef *tref, const bToolRef_Runtime *tref_rt, const char *idname) { + Main *bmain = CTX_data_main(C); + if (tref->runtime) { toolsystem_unlink_ref(C, workspace, tref); } @@ -298,7 +302,8 @@ void WM_toolsystem_ref_set_from_runtime( toolsystem_ref_link(C, workspace, tref); - /* TODO(campbell): fix message. */ + toolsystem_refresh_screen_from_active_tool(bmain, workspace, tref); + { struct wmMsgBus *mbus = CTX_wm_message_bus(C); WM_msg_publish_rna_prop(