Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-05-28 11:00:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-05-28 11:46:15 +0300
commit4be7258f003ea6894bfe28173246279393ea19ec (patch)
tree8a7fd5f8b01bf43b490b7d40e0d2bf9f481c61aa /source/blender/windowmanager
parent3dd346c2a15d0ded724f29459af0116e8ff6b955 (diff)
WM: remove windows if they fail to initialize
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 9bcbbabc87b..6d1bf51902c 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;
+ }
}