diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 10 |
4 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 6f7bedffda4..8eab8662ea9 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -101,6 +101,7 @@ 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; 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, diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e842db64015..2852b1b4d24 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -409,12 +409,13 @@ void wm_event_do_notifiers(bContext *C) for (win = wm->windows.first; win; win = win->next) { Scene *scene = WM_window_get_active_scene(win); bScreen *screen = WM_window_get_active_screen(win); + WorkSpace *workspace = WM_window_get_active_workspace(win); /* filter out notifiers */ if (note->category == NC_SCREEN && note->reference && note->reference != screen && - note->reference != WM_window_get_active_workspace(win) && + note->reference != workspace && note->reference != WM_window_get_active_layout(win)) { /* pass */ @@ -437,7 +438,7 @@ void wm_event_do_notifiers(bContext *C) } for (sa = screen->areabase.first; sa; sa = sa->next) { - ED_area_do_listen(screen, sa, note, scene); + ED_area_do_listen(screen, sa, note, scene, workspace); for (ar = sa->regionbase.first; ar; ar = ar->next) { ED_region_do_listen(screen, sa, ar, note, scene); } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 3de6824c23d..33f7a2ecb4d 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -433,8 +433,9 @@ void wm_file_read_report(bContext *C) Scene *sce; for (sce = G.main->scene.first; sce; sce = sce->id.next) { - if (sce->r.engine[0] && - BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL) + ViewRender *view_render = &sce->view_render; + if (view_render->engine_id[0] && + BLI_findstring(&R_engines, view_render->engine_id, offsetof(RenderEngineType, idname)) == NULL) { if (reports == NULL) { reports = CTX_wm_reports(C); @@ -442,7 +443,7 @@ void wm_file_read_report(bContext *C) BKE_reportf(reports, RPT_ERROR, "Engine '%s' not available for scene '%s' (an add-on may need to be installed or enabled)", - sce->r.engine, sce->id.name + 2); + view_render->engine_id, sce->id.name + 2); } } @@ -1000,7 +1001,7 @@ static void wm_history_file_update(void) /* screen can be NULL */ -static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *sl, bScreen *screen, BlendThumbnail **thumb_pt) +static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *scene_layer, bScreen *screen, BlendThumbnail **thumb_pt) { /* will be scaled down, but gives some nice oversampling */ ImBuf *ibuf; @@ -1041,14 +1042,14 @@ static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *sl, /* gets scaled to BLEN_THUMB_SIZE */ if (scene->camera) { ibuf = ED_view3d_draw_offscreen_imbuf_simple( - &eval_ctx, scene, sl, scene->camera, + &eval_ctx, scene, scene_layer, scene->camera, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, IB_rect, OB_SOLID, false, false, false, R_ALPHAPREMUL, 0, false, NULL, NULL, NULL, err_out); } else { ibuf = ED_view3d_draw_offscreen_imbuf( - &eval_ctx, scene, sl, v3d, ar, + &eval_ctx, scene, scene_layer, v3d, ar, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, IB_rect, false, R_ALPHAPREMUL, 0, false, NULL, NULL, NULL, err_out); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 09b2b50687a..0d2f68ca4ac 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1938,6 +1938,16 @@ Scene *WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen return NULL; } +WorkSpace *WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const bScreen *screen) +{ + for (wmWindow *win = wm->windows.first; win; win = win->next) { + if (WM_window_get_active_screen(win) == screen) { + return WM_window_get_active_workspace(win); + } + } + return NULL; +} + Scene *WM_window_get_active_scene(const wmWindow *win) { return win->scene; |