diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-11-15 02:23:52 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-11-15 02:23:52 +0300 |
commit | 96ce32dca6ab92ac9fbd807fd50525cc5e50c636 (patch) | |
tree | 174a2dfd6bb8774b5afed15a912df481a52eef49 /source | |
parent | 91248876e517983531c44ffc1692674684c67eed (diff) |
Fix T71590: Closing file browser reopens previously closed render view
The render view window was never closed actually, just moved behind the
main window. It's properly closed now.
It should also behave more like expected when there already is a
temporary window open (e.g. Preferences).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/render/render_view.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 2052128cb36..9849be2a57b 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -24,6 +24,7 @@ #include <string.h> #include <stddef.h> +#include "BLI_listbase.h" #include "BLI_utildefines.h" #include "DNA_scene_types.h" @@ -163,6 +164,10 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) } sa = CTX_wm_area(C); + if (BLI_listbase_is_single(&sa->spacedata) == false) { + sima = sa->spacedata.first; + sima->flag |= SI_PREVSPACE; + } } else if (U.render_display_type == USER_RENDER_DISPLAY_SCREEN) { sa = CTX_wm_area(C); @@ -264,13 +269,8 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op)) sima->flag &= ~SI_FULLWINDOW; } - /* test if we have a temp screen in front */ - if (WM_window_is_temp_screen(win)) { - wm_window_lower(win); - return OPERATOR_FINISHED; - } /* determine if render already shows */ - else if (sima->flag & SI_PREVSPACE) { + if (sima->flag & SI_PREVSPACE) { sima->flag &= ~SI_PREVSPACE; if (sima->flag & SI_FULLWINDOW) { @@ -288,6 +288,10 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op)) ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED); return OPERATOR_FINISHED; } + else if (WM_window_is_temp_screen(win)) { + wm_window_close(C, CTX_wm_manager(C), win); + return OPERATOR_FINISHED; + } return OPERATOR_PASS_THROUGH; } |