From 35e92f54a1cdf0458c9090821d0966ee21ed0bd7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Jun 2013 06:21:10 +0000 Subject: [PATCH] make screenshot poll for background mode. --- source/blender/editors/screen/screendump.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 527715cdbd3..b16721640da 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -254,6 +254,13 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op) uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0'); } +static int screenshot_poll(bContext *C) +{ + if (G.background) + return false; + + return WM_operator_winactive(C); +} void SCREEN_OT_screenshot(wmOperatorType *ot) { @@ -266,7 +273,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot) ot->exec = screenshot_exec; ot->cancel = screenshot_cancel; ot->ui = screenshot_draw; - ot->poll = WM_operator_winactive; + ot->poll = screenshot_poll; ot->flag = 0;