예제 #1
0
/* operator callback */
int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
{
	wm_window_copy(C, CTX_wm_window(C));
	WM_check(C);
	
	WM_event_add_notifier(C, NC_WINDOW | NA_ADDED, NULL);
	
	return OPERATOR_FINISHED;
}
예제 #2
0
/**
 * A higher level version of copy that tests the new window can be added.
 * (called from the operator directly)
 */
wmWindow *wm_window_copy_test(bContext *C, wmWindow *win_src)
{
    wmWindowManager *wm = CTX_wm_manager(C);
    wmWindow *win_dst;

    win_dst = wm_window_copy(C, win_src);

    WM_check(C);

    if (win_dst->ghostwin) {
        WM_event_add_notifier(C, NC_WINDOW | NA_ADDED, NULL);
        return win_dst;
    }
    else {
        wm_window_close(C, wm, win_dst);
        return NULL;
    }
}