diff options
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 20 |
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; + } } |