@@ -6,19 +6,13 @@ BGEffectHandler::BGEffectHandler(Hyperion* hyperion)
66 : QObject(hyperion)
77 , _hyperion(hyperion)
88 , _isBgEffectEnabled(false )
9- , _isSuspended(false )
109{
1110 QString subComponent = parent ()->property (" instance" ).toString ();
1211 _log = Logger::getInstance (" HYPERION" , subComponent);
1312
1413 QObject::connect (_hyperion, &Hyperion::settingsChanged, this , &BGEffectHandler::handleSettingsUpdate);
1514 QObject::connect (_hyperion->getMuxerInstance ().get (), &PriorityMuxer::prioritiesChanged, this , &BGEffectHandler::handlePriorityUpdate);
1615
17- // listen for suspend/resume requests, to not start a background effect when system goes into suspend mode
18- connect (_hyperion, &Hyperion::suspendRequest, this , [=] (bool isSuspended) {
19- _isSuspended = isSuspended;
20- });
21-
2216 // initialization
2317 handleSettingsUpdate (settings::BGEFFECT, _hyperion->getSetting (settings::BGEFFECT));
2418}
@@ -90,9 +84,13 @@ void BGEffectHandler::handlePriorityUpdate(int currentPriority)
9084 Debug (_log," Stop background (color-) effect as it moved out of scope" );
9185 _hyperion->clear (PriorityMuxer::BG_PRIORITY);
9286 }
93- else if (!_isSuspended && currentPriority == PriorityMuxer::LOWEST_PRIORITY && _isBgEffectEnabled)
87+ // Do not start a background effect when the overall instance is disabled
88+ else if (_hyperion->isComponentEnabled (hyperion::COMP_ALL))
9489 {
95- Debug (_log," Start background (color-) effect as it moved in scope" );
96- emit handleSettingsUpdate (settings::BGEFFECT, _bgEffectConfig);
90+ if (currentPriority == PriorityMuxer::LOWEST_PRIORITY && _isBgEffectEnabled)
91+ {
92+ Debug (_log, " Start background (color-) effect as it moved in scope" );
93+ emit handleSettingsUpdate (settings::BGEFFECT, _bgEffectConfig);
94+ }
9795 }
9896}
0 commit comments