Use QApplication::applicationState to detect if we're in the background.

May want to expand upon this at some point; if we’re hidden we most
definitely *do not* want to render anything
This commit is contained in:
Geenz 2014-03-12 20:49:58 -04:00
parent 9c61f12926
commit e27af75ad2

View file

@ -53,12 +53,9 @@ void GLCanvas::mouseReleaseEvent(QMouseEvent* event) {
Application::getInstance()->mouseReleaseEvent(event);
}
void GLCanvas::activeChanged()
{
if (!isActiveWindow())
{
if (!_throttleRendering)
{
void GLCanvas::activeChanged() {
if (Application::applicationState() != Qt::ApplicationActive) {
if (!_throttleRendering) {
_frameTimer.start(_idleRenderInterval);
_throttleRendering = true;
}