From da294d646d7f31855822b06f18ff5b061237eaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Wed, 7 Apr 2021 19:25:58 +0300 Subject: Fix activation for datainput controlled components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the check for parent activation from the GotoSlideIndex activation check. The component activation check can only be passed if the component is actually active since that activates all it's children. Any parent being activated doesn't mean that the component should be activated. Add proper fix for QT3DS-4214 by checking if the component is datainput controlled active. The AboutToDeactivate checks if the component is dirty(implies activity change) and not explicitly active and returns true for data input controlled components even if it is active by data inputs. Task-number: QT3DS-4227 Change-Id: I9fcd4f947ba137d7c0e856da15a3d8480ed07c0e Reviewed-by: Tomi Korpipää --- src/runtime/Qt3DSComponentManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runtime/Qt3DSComponentManager.cpp b/src/runtime/Qt3DSComponentManager.cpp index f20176b..2665c4a 100644 --- a/src/runtime/Qt3DSComponentManager.cpp +++ b/src/runtime/Qt3DSComponentManager.cpp @@ -85,12 +85,12 @@ void CComponentManager::GotoSlideIndex(TElement *inComponent, return; } - if (!theComponent->IsAnyParentAboutToActivate()) { - if (!theComponent->GetActive() || theComponent->AboutToDeactivate()) { - // When (becoming) not active, don't proceed slide switching - m_ComponentInitialSlideMap[inComponent] = inGotoData; - return; - } + // This check prevents slide changes to inactive components from activating the component children. + // Slide switch can proceed only if the component is actually active. + if (!theComponent->GetActive() || (theComponent->AboutToDeactivate() + && !theComponent->IsControlledActive())) { + m_ComponentInitialSlideMap[inComponent] = inGotoData; + return; } SComponentGotoSlideData theGotoSlideData(inGotoData); -- cgit v1.2.3