From a2baf50242a315961fc7bc4d202a610442e813ec Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 26 May 2020 20:32:21 +0200 Subject: Cleanup/refactor: Workspace API, boilerplate code, early exit * Simplify workspace API a bit * Comment on behavior of workspace-layout relations where exposed in API * Remove annoying getters/setters * Avoid lookups if we can early exit * A NULL check is removed in `direct_link_workspace()` that I don't see a need for. Am not 100% sure though, fingers crossed. In general these changes should improve readability and make things easier to reason about. --- source/blender/windowmanager/intern/wm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/windowmanager/intern/wm.c') diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 9aaaa0e2c81..0032a341610 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -388,7 +388,7 @@ void wm_add_default(Main *bmain, bContext *C) win->scene = CTX_data_scene(C); STRNCPY(win->view_layer_name, CTX_data_view_layer(C)->name); BKE_workspace_active_set(win->workspace_hook, workspace); - BKE_workspace_hook_layout_for_workspace_set(win->workspace_hook, workspace, layout); + BKE_workspace_active_layout_set(win->workspace_hook, workspace, layout); screen->winid = win->winid; wm->winactive = win; -- cgit v1.2.3