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).
This commit is contained in:
Julian Eisel 2019-11-15 00:23:52 +01:00
parent 91248876e5
commit 96ce32dca6
Notes: blender-bot 2023-02-14 00:13:36 +01:00
Referenced by issue #71590, Cancelling the File browser after having cancelled the render view shows the render view
1 changed files with 10 additions and 6 deletions

View File

@ -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;
}