diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:20:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:21:14 +0300 |
commit | 1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 (patch) | |
tree | 7a5af59ce078cb66fb17ec33cf111ffc8d5fb328 /source/blender/windowmanager | |
parent | 57329304b061efe756e3a4ce1b828e9a7c7f7030 (diff) |
Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 32 |
3 files changed, 26 insertions, 18 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 294134767c7..377d274a712 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -67,8 +67,7 @@ struct ARegion; struct ScrArea; struct Main; struct bToolDef; - -#include "DNA_object_enums.h" +struct ViewLayer; #ifdef WITH_INPUT_NDOF struct wmNDOFMotionData; @@ -105,7 +104,6 @@ bool WM_window_is_fullscreen (struct wmWindow *win); void WM_windows_scene_data_sync(const ListBase *win_lb, struct Scene *scene) ATTR_NONNULL(); struct Scene *WM_windows_scene_get_from_screen(const struct wmWindowManager *wm, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; struct WorkSpace *WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -eObjectMode WM_windows_object_mode_get(const struct wmWindowManager *wm) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; struct Scene *WM_window_get_active_scene(const struct wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; void WM_window_change_active_scene(struct Main *bmain, struct bContext *C, struct wmWindow *win, @@ -117,6 +115,10 @@ void WM_window_set_active_layout( struct wmWindow *win, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL(1); struct bScreen *WM_window_get_active_screen(const struct wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; void WM_window_set_active_screen(struct wmWindow *win, struct WorkSpace *workspace, struct bScreen *screen) ATTR_NONNULL(1); + +struct ViewLayer *WM_window_get_active_view_layer_ex(const struct wmWindow *win, struct Scene **r_scene) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +struct ViewLayer *WM_window_get_active_view_layer(const struct wmWindow *win) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; + bool WM_window_is_temp_screen(const struct wmWindow *win) ATTR_WARN_UNUSED_RESULT; void *WM_opengl_context_create(void); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 33bbb624192..fcf06804e94 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -338,8 +338,6 @@ void wm_event_do_refresh_wm_and_depsgraph(bContext *C) WorkSpace *workspace = WM_window_get_active_workspace(win); - BKE_workspace_update_object_mode(bmain->eval_ctx, workspace); - BKE_workspace_update_tagged(bmain->eval_ctx, bmain, workspace, scene); } } @@ -384,7 +382,7 @@ void wm_event_do_notifiers(bContext *C) UI_popup_handlers_remove_all(C, &win->modalhandlers); - ED_workspace_change(ref_ws, C, win); + ED_workspace_change(ref_ws, C, wm, win); if (G.debug & G_DEBUG_EVENTS) printf("%s: Workspace set %p\n", __func__, note->reference); } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d482c107fe6..51b25d3e7de 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -2123,18 +2123,6 @@ WorkSpace *WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const return NULL; } -eObjectMode WM_windows_object_mode_get(const struct wmWindowManager *wm) -{ - eObjectMode object_mode = 0; - for (wmWindow *win = wm->windows.first; win; win = win->next) { - const WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook); - if (workspace != NULL) { - object_mode |= workspace->object_mode; - } - } - return object_mode; -} - Scene *WM_window_get_active_scene(const wmWindow *win) { return win->scene; @@ -2184,6 +2172,26 @@ void WM_window_set_active_screen(wmWindow *win, WorkSpace *workspace, bScreen *s BKE_workspace_active_screen_set(win->workspace_hook, workspace, screen); } +struct ViewLayer *WM_window_get_active_view_layer_ex(const wmWindow *win, Scene **r_scene) +{ + const WorkSpace *workspace = WM_window_get_active_workspace(win); + Scene *scene = WM_window_get_active_scene(win); + /* May be NULL in rare cases like closing Blender */ + bScreen *screen = (LIKELY(workspace != NULL) ? BKE_workspace_active_screen_get(win->workspace_hook) : NULL); + if (screen != NULL) { + if (r_scene) { + *r_scene = scene; + } + return BKE_workspace_view_layer_get(workspace, scene); + } + return NULL; +} + +struct ViewLayer *WM_window_get_active_view_layer(const wmWindow *win) +{ + return WM_window_get_active_view_layer_ex(win, NULL); +} + bool WM_window_is_temp_screen(const wmWindow *win) { const bScreen *screen = WM_window_get_active_screen(win); |