[Bf-blender-cvs] [ffd26b420ce] master: Fix crash closing a window in background mode

Campbell Barton noreply at git.blender.org
Thu Mar 26 05:41:35 CET 2020


Commit: ffd26b420ce991c983c68d6c2b00459aefd6c012
Author: Campbell Barton
Date:   Thu Mar 26 12:46:25 2020 +1100
Branches: master
https://developer.blender.org/rBffd26b420ce991c983c68d6c2b00459aefd6c012

Fix crash closing a window in background mode

===================================================================

M	source/blender/windowmanager/intern/wm_window.c

===================================================================

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);
+        }
+      }
     }
   }



More information about the Bf-blender-cvs mailing list