Merge branch 'blender-v2.93-release'

This commit is contained in:
Campbell Barton 2021-04-30 15:16:04 +10:00
commit 5a40c79520
3 changed files with 15 additions and 3 deletions

View File

@ -304,6 +304,7 @@ void ED_operatortypes_workspace(void);
/* operators; context poll callbacks */
bool ED_operator_screenactive(struct bContext *C);
bool ED_operator_screenactive_nobackground(struct bContext *C);
bool ED_operator_screen_mainwinactive(struct bContext *C);
bool ED_operator_areaactive(struct bContext *C);
bool ED_operator_regionactive(struct bContext *C);

View File

@ -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)
{
@ -4959,7 +4967,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. */
}
/** \} */
@ -5036,7 +5044,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. */
}
/** \} */
@ -5080,7 +5088,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;
}
/** \} */

View File

@ -1911,6 +1911,9 @@ static bool wm_operator_winactive_normal(bContext *C)
if (!((screen = WM_window_get_active_screen(win)) && (screen->state == SCREENNORMAL))) {
return 0;
}
if (G.background) {
return 0;
}
return 1;
}