diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 07:16:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 07:16:50 +0300 |
commit | 2ed847317e7da8de86846766c54f40c5ee7cee73 (patch) | |
tree | e6749fde591b4cc7d93b0103bbd928c2b1ea8544 /source/blender/editors/screen/screen_ops.c | |
parent | caf1643f4a779cb13523843252fde930e615e865 (diff) |
Fix crash running window operators in background mode
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5cd4e8c353b..765877d6a8e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -141,6 +141,14 @@ bool ED_operator_screenactive(bContext *C) return true; } +bool ED_operator_screenactive_nobackground(bContext *C) +{ + if (G.background) { + return false; + } + return ED_operator_screenactive(C); +} + /* XXX added this to prevent anim state to change during renders */ static bool ED_operator_screenactive_norender(bContext *C) { @@ -4883,7 +4891,7 @@ static void SCREEN_OT_userpref_show(struct wmOperatorType *ot) /* api callbacks */ ot->exec = userpref_show_exec; - ot->poll = ED_operator_screenactive; + ot->poll = ED_operator_screenactive_nobackground; /* Not in background as this opens a window. */ } /** \} */ @@ -4960,7 +4968,7 @@ static void SCREEN_OT_drivers_editor_show(struct wmOperatorType *ot) /* api callbacks */ ot->exec = drivers_editor_show_exec; - ot->poll = ED_operator_screenactive; + ot->poll = ED_operator_screenactive_nobackground; /* Not in background as this opens a window. */ } /** \} */ @@ -5004,7 +5012,7 @@ static void SCREEN_OT_info_log_show(struct wmOperatorType *ot) /* api callbacks */ ot->exec = info_log_show_exec; - ot->poll = ED_operator_screenactive; + ot->poll = ED_operator_screenactive_nobackground; } /** \} */ |