[Bf-blender-cvs] [51263c6] master: Fix T37731: some window manager operators unnecessarily required a window to be active.

Brecht Van Lommel noreply at git.blender.org
Sun Dec 8 00:09:47 CET 2013


Commit: 51263c6637906f1f381f3b535120cba163b5ab40
Author: Brecht Van Lommel
Date:   Sat Dec 7 23:58:18 2013 +0100
http://developer.blender.org/rB51263c6637906f1f381f3b535120cba163b5ab40

Fix T37731: some window manager operators unnecessarily required a window to be active.

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

M	source/blender/windowmanager/intern/wm_files.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 5939128..09192c5 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -977,7 +977,7 @@ int wm_homefile_write_exec(bContext *C, wmOperator *op)
 	int fileflags;
 
 	/* check current window and close it if temp */
-	if (win->screen->temp)
+	if (win && win->screen->temp)
 		wm_window_close(C, wm, win);
 	
 	/* update keymaps in user preferences */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 79d0cd0..91790f7 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1957,7 +1957,6 @@ static void WM_OT_save_homefile(wmOperatorType *ot)
 		
 	ot->invoke = WM_operator_confirm;
 	ot->exec = wm_homefile_write_exec;
-	ot->poll = WM_operator_winactive;
 }
 
 static int wm_userpref_autoexec_add_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
@@ -1974,7 +1973,6 @@ static void WM_OT_userpref_autoexec_path_add(wmOperatorType *ot)
 	ot->description = "Add path to exclude from autoexecution";
 
 	ot->exec = wm_userpref_autoexec_add_exec;
-	ot->poll = WM_operator_winactive;
 
 	ot->flag = OPTYPE_INTERNAL;
 }
@@ -1996,7 +1994,6 @@ static void WM_OT_userpref_autoexec_path_remove(wmOperatorType *ot)
 	ot->description = "Remove path to exclude from autoexecution";
 
 	ot->exec = wm_userpref_autoexec_remove_exec;
-	ot->poll = WM_operator_winactive;
 
 	ot->flag = OPTYPE_INTERNAL;
 
@@ -2011,7 +2008,6 @@ static void WM_OT_save_userpref(wmOperatorType *ot)
 	
 	ot->invoke = WM_operator_confirm;
 	ot->exec = wm_userpref_write_exec;
-	ot->poll = WM_operator_winactive;
 }
 
 static void WM_OT_read_history(wmOperatorType *ot)
@@ -2470,7 +2466,6 @@ static void WM_OT_recover_last_session(wmOperatorType *ot)
 	ot->description = "Open the last closed file (\"" BLENDER_QUIT_FILE "\")";
 	
 	ot->exec = wm_recover_last_session_exec;
-	ot->poll = WM_operator_winactive;
 }
 
 /* *************** recover auto save **************** */
@@ -2515,7 +2510,6 @@ static void WM_OT_recover_auto_save(wmOperatorType *ot)
 	
 	ot->exec = wm_recover_auto_save_exec;
 	ot->invoke = wm_recover_auto_save_invoke;
-	ot->poll = WM_operator_winactive;
 
 	WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE,
 	                               WM_FILESEL_FILEPATH, FILE_LONGDISPLAY);
@@ -2743,7 +2737,6 @@ static void WM_OT_quit_blender(wmOperatorType *ot)
 
 	ot->invoke = WM_operator_confirm;
 	ot->exec = wm_exit_blender_exec;
-	ot->poll = WM_operator_winactive;
 }
 
 /* *********************** */




More information about the Bf-blender-cvs mailing list