diff options
-rw-r--r-- | source/blender/editors/render/render_internal.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 5426a0e9df2..f6805094056 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -843,34 +843,46 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(unused), wmEv { ScrArea *sa= find_area_showing_r_result(C); - /* test if we have a temp screen in front */ + /* test if we have a temp screen active */ if(CTX_wm_window(C)->screen->temp) { wm_window_lower(CTX_wm_window(C)); } - /* determine if render already shows */ - else if(sa) { - SpaceImage *sima= sa->spacedata.first; + else { + /* is there another window? */ + wmWindow *win; + + for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) { + if(win->screen->temp) { + wm_window_raise(win); + return OPERATOR_FINISHED; + } + } + + /* determine if render already shows */ + if(sa) { + SpaceImage *sima= sa->spacedata.first; - if(sima->flag & SI_PREVSPACE) { - sima->flag &= ~SI_PREVSPACE; + if(sima->flag & SI_PREVSPACE) { + sima->flag &= ~SI_PREVSPACE; - if(sima->flag & SI_FULLWINDOW) { - sima->flag &= ~SI_FULLWINDOW; - ED_screen_full_prevspace(C, sa); - } - else if(sima->next) { - /* workaround for case of double prevspace, render window - with a file browser on top of it (same as in ED_area_prevspace) */ - if(sima->next->spacetype == SPACE_FILE && sima->next->next) - ED_area_newspace(C, sa, sima->next->next->spacetype); - else - ED_area_newspace(C, sa, sima->next->spacetype); - ED_area_tag_redraw(sa); + if(sima->flag & SI_FULLWINDOW) { + sima->flag &= ~SI_FULLWINDOW; + ED_screen_full_prevspace(C, sa); + } + else if(sima->next) { + /* workaround for case of double prevspace, render window + with a file browser on top of it (same as in ED_area_prevspace) */ + if(sima->next->spacetype == SPACE_FILE && sima->next->next) + ED_area_newspace(C, sa, sima->next->next->spacetype); + else + ED_area_newspace(C, sa, sima->next->spacetype); + ED_area_tag_redraw(sa); + } } } - } - else { - screen_set_image_output(C, event->x, event->y); + else { + screen_set_image_output(C, event->x, event->y); + } } return OPERATOR_FINISHED; |