diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-21 17:59:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-21 17:59:36 +0300 |
commit | 4653d253b390fbb61163610d60ac4c0d21db23ae (patch) | |
tree | 6e57fc8864f5d664afd74406fa9e8002740818ac /source/blender/windowmanager | |
parent | 803636f888c1f74d73bf4f09ed396647c869a4a3 (diff) |
Fix T67805: Cursor doesn't update when switching tools via shortcuts
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 616cb7613ba..24e9aa0028c 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -374,6 +374,16 @@ void WM_toolsystem_ref_set_from_runtime(struct bContext *C, toolsystem_refresh_screen_from_active_tool(bmain, workspace, tref); + /* Set the cursor if possible, if not - it's fine as entering the region will refresh it. */ + { + wmWindow *win = CTX_wm_window(C); + ScrArea *sa = CTX_wm_area(C); + if (win && sa) { + win->addmousemove = true; + sa->flag |= AREA_FLAG_CURSOR_UPDATE; + } + } + { struct wmMsgBus *mbus = CTX_wm_message_bus(C); WM_msg_publish_rna_prop(mbus, &workspace->id, workspace, WorkSpace, tools); @@ -651,6 +661,10 @@ static void toolsystem_refresh_screen_from_active_tool(Main *bmain, if (mode == tref->mode) { sa->runtime.tool = tref; sa->runtime.is_tool_set = true; + /* We only need to do this for the active area, + * however at this point the context isn't available. + * Set this here since it doesn't cause any extra work. */ + sa->flag |= AREA_FLAG_CURSOR_UPDATE; } } } |