From 525e7ad7d4177ad79fe4a4cc7e497b42d04287b3 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 4 Mar 2012 12:46:46 +0100 Subject: [PATCH] skip screenshot when window isn't active. Closes #931 --- src/engine/client/graphics.cpp | 3 ++- src/engine/client/graphics_threaded.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index 2111703e1..ae0fcade0 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -929,7 +929,8 @@ void CGraphics_SDL::Swap() { if(m_DoScreenshot) { - ScreenshotDirect(m_aScreenshotName); + if(WindowActive()) + ScreenshotDirect(m_aScreenshotName); m_DoScreenshot = false; } diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index b19e8a836..846f03698 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -843,7 +843,8 @@ void CGraphics_Threaded::Swap() // TODO: screenshot support if(m_DoScreenshot) { - ScreenshotDirect(m_aScreenshotName); + if(WindowActive()) + ScreenshotDirect(m_aScreenshotName); m_DoScreenshot = false; }