[Bf-blender-cvs] [4be7258] master: WM: remove windows if they fail to initialize

Campbell Barton noreply at git.blender.org
Thu May 28 10:46:48 CEST 2015


Commit: 4be7258f003ea6894bfe28173246279393ea19ec
Author: Campbell Barton
Date:   Thu May 28 18:00:53 2015 +1000
Branches: master
https://developer.blender.org/rB4be7258f003ea6894bfe28173246279393ea19ec

WM: remove windows if they fail to initialize

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

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 9bcbbab..6d1bf51 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -615,12 +615,22 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
 /* operator callback */
 int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	wm_window_copy(C, CTX_wm_window(C));
+	wmWindowManager *wm = CTX_wm_manager(C);
+	wmWindow *win_src = CTX_wm_window(C);
+	wmWindow *win_dst;
+
+	win_dst = wm_window_copy(C, win_src);
+
 	WM_check(C);
-	
-	WM_event_add_notifier(C, NC_WINDOW | NA_ADDED, NULL);
-	
-	return OPERATOR_FINISHED;
+
+	if (win_dst->ghostwin) {
+		WM_event_add_notifier(C, NC_WINDOW | NA_ADDED, NULL);
+		return OPERATOR_FINISHED;
+	}
+	else {
+		wm_window_close(C, wm, win_dst);
+		return OPERATOR_CANCELLED;
+	}
 }




More information about the Bf-blender-cvs mailing list