diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-15 01:43:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-15 01:48:20 +0300 |
commit | 7f8f362e018e99376387ed62629749024acab28d (patch) | |
tree | 6f261af9051e50b14abcb0b99efb303d8106428c /source/blender/blenkernel/intern/workspace.c | |
parent | ded8f5cc1903ce848fc88b102b76140fb1a21937 (diff) |
Tool System: avoid redundant refresh
Workspaces refreshes tools multiple times when used by multiple windows.
Also improve comments.
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r-- | source/blender/blenkernel/intern/workspace.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index 909aa73ff03..669eb5c42dc 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -36,6 +36,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" #include "DNA_workspace_types.h" #include "DEG_depsgraph.h" @@ -367,11 +368,21 @@ bool BKE_workspace_owner_id_check(const WorkSpace *workspace, const char *owner_ return true; } else { - /* we could use hash lookup, for now this list is highly under < ~16 items. */ + /* We could use hash lookup, for now this list is highly likely under < ~16 items. */ return BLI_findstring(&workspace->owner_ids, owner_id, offsetof(wmOwnerID, name)) != NULL; } } +void BKE_workspace_id_tag_all_visible(Main *bmain, int tag) +{ + BKE_main_id_tag_listbase(&bmain->workspaces, tag, false); + wmWindowManager *wm = bmain->wm.first; + for (wmWindow *win = wm->windows.first; win; win = win->next) { + WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook); + workspace->id.tag |= tag; + } +} + /** \} */ /* -------------------------------------------------------------------- */ |