diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 08:25:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 08:27:53 +0300 |
commit | 05ec0108dca544785ae55cbe847eaa058457df3d (patch) | |
tree | 9617df2a254b575cf7cef77dc527bab13ab05104 /source/blender/windowmanager | |
parent | 469d43b1dbc54d2afcbfe104a2d8ca9c03df9b81 (diff) |
WM: refresh tool on object mode switch
The tool manipulator could become disabled when set in the wrong mode.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 31c30388560..9176385c40d 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -53,6 +53,8 @@ struct wmEvent; struct wmEventHandler; struct wmGesture; struct wmJob; +struct wmMsgSubscribeKey; +struct wmMsgSubscribeValue; struct wmOperatorType; struct wmOperator; struct rcti; @@ -595,12 +597,16 @@ bool WM_event_is_ime_switch(const struct wmEvent *event); /* wm_toolsystem.c */ void WM_toolsystem_unlink(struct bContext *C, struct WorkSpace *workspace); void WM_toolsystem_link(struct bContext *C, struct WorkSpace *workspace); +void WM_toolsystem_refresh(struct bContext *C, struct WorkSpace *workspace); void WM_toolsystem_set(struct bContext *C, const struct bToolDef *tool); void WM_toolsystem_init(struct bContext *C); bool WM_toolsystem_active_tool_is_brush(const struct bContext *C); +void WM_toolsystem_do_msg_notify_tag_refresh( + struct bContext *C, struct wmMsgSubscribeKey *msg_key, struct wmMsgSubscribeValue *msg_val); + /* wm_tooltip.c */ typedef struct ARegion *(*wmTooltipInitFn)(struct bContext *, struct ARegion *, bool *); diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index e449695e3cf..04542717b24 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -114,6 +114,11 @@ void WM_toolsystem_link(bContext *C, WorkSpace *workspace) } } +void WM_toolsystem_refresh(bContext *C, WorkSpace *workspace) +{ + WM_toolsystem_link(C, workspace); +} + void WM_toolsystem_set(bContext *C, const bToolDef *tool) { WorkSpace *workspace = CTX_wm_workspace(C); @@ -159,3 +164,11 @@ bool WM_toolsystem_active_tool_is_brush(const bContext *C) /* Will need to become more comprehensive, for now check tool data-block. */ return workspace->tool.data_block[0] != '\0'; } + +/* Follow wmMsgNotifyFn spec */ +void WM_toolsystem_do_msg_notify_tag_refresh( + bContext *C, wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val) +{ + WorkSpace *workspace = CTX_wm_workspace(C); + WM_toolsystem_refresh(C, workspace); +} |