diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 04:46:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 07:32:40 +0300 |
commit | ffd26b420ce991c983c68d6c2b00459aefd6c012 (patch) | |
tree | 48ed9dcf39b2a4ed5f01b5953d5026626e52b835 /source/blender/windowmanager/intern/wm_window.c | |
parent | 7354f07eadcc276c0daf83954aced41a0d6a265a (diff) |
Fix crash closing a window in background mode
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index a3e1814f8d2..505383d295f 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -414,7 +414,7 @@ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) { wmWindow *win_other; - const bool is_dialog = GHOST_IsDialogWindow(win->ghostwin); + const bool is_dialog = (G.background == false) ? GHOST_IsDialogWindow(win->ghostwin) : false; /* First check if there is another main window remaining. */ for (win_other = wm->windows.first; win_other; win_other = win_other->next) { @@ -434,9 +434,13 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) if (iter_win->parent == win) { wm_window_close(C, wm, iter_win); } - else if (is_dialog && iter_win != win && iter_win->parent && - (GHOST_GetWindowState(iter_win->ghostwin) != GHOST_kWindowStateMinimized)) { - wm_window_raise(iter_win); + else { + if (G.background == false) { + if (is_dialog && iter_win != win && iter_win->parent && + (GHOST_GetWindowState(iter_win->ghostwin) != GHOST_kWindowStateMinimized)) { + wm_window_raise(iter_win); + } + } } } |