diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-28 12:36:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-28 12:38:44 +0300 |
commit | 56d52466eff5142e36eb2b95e0b4015ed32e6bfd (patch) | |
tree | 770f018a421525dc64e2b97ec0486860fa4b437a /source | |
parent | f35ef57c8c4f218548926b49dbc950b056d8de4e (diff) |
Fix message subscriber using the wrong workspace
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 9ed1322ec63..11286a822a7 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -799,12 +799,23 @@ void WM_toolsystem_do_msg_notify_tag_refresh(bContext *C, wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val) { - WorkSpace *workspace = CTX_wm_workspace(C); - ViewLayer *view_layer = CTX_data_view_layer(C); ScrArea *sa = msg_val->user_data; - int space_type = sa->spacetype; + Main *bmain = CTX_data_main(C); + wmWindow *win = ((wmWindowManager *)bmain->wm.first)->windows.first; + if (win->next != NULL) { + do { + bScreen *screen = WM_window_get_active_screen(win); + if (BLI_findindex(&screen->areabase, sa) != -1) { + break; + } + } while ((win = win->next)); + } + + WorkSpace *workspace = WM_window_get_active_workspace(win); + ViewLayer *view_layer = WM_window_get_active_view_layer(win); + const bToolKey tkey = { - .space_type = space_type, + .space_type = sa->spacetype, .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), }; WM_toolsystem_refresh(C, workspace, &tkey); |