From 4d0a80ce6d4f2cf81179a20954d81a3f848a1a2e Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 12 Sep 2019 10:44:06 +0200 Subject: [PATCH] stop animators, when the window becomes invisible --- src/controls/QskAnimator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controls/QskAnimator.cpp b/src/controls/QskAnimator.cpp index 69bfedbf..e9d4d03c 100644 --- a/src/controls/QskAnimator.cpp +++ b/src/controls/QskAnimator.cpp @@ -148,6 +148,9 @@ void QskAnimatorDriver::registerAnimator( QskAnimator* animator ) connect( window, &QQuickWindow::frameSwapped, this, [ this, window ]() { scheduleUpdate( window ); } ); + connect( window, &QWindow::visibleChanged, + this, [ this, window ]( bool on ) { if ( !on ) removeWindow( window ); } ); + connect( window, &QObject::destroyed, this, [ this, window ]( QObject* ) { removeWindow( window ); } );