mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-12-14 04:20:25 +00:00
commit
dc595580d4
@ -475,6 +475,32 @@ void WindowScene::OnConnect()
|
|||||||
pipelineContext->PostAsyncEvent(std::move(uiTask), "ArkUIWindowSceneConnect", TaskExecutor::TaskType::UI);
|
pipelineContext->PostAsyncEvent(std::move(uiTask), "ArkUIWindowSceneConnect", TaskExecutor::TaskType::UI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowScene::OnForeground()
|
||||||
|
{
|
||||||
|
auto uiTask = [weakThis = WeakClaim(this)]() {
|
||||||
|
ACE_SCOPED_TRACE("WindowScene::OnForeground");
|
||||||
|
auto self = weakThis.Upgrade();
|
||||||
|
CHECK_NULL_VOID(self);
|
||||||
|
CHECK_NULL_VOID(self->session_);
|
||||||
|
if (self->session_->IsAnco()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CHECK_NULL_VOID(self->snapshotWindow_);
|
||||||
|
auto surfaceNode = self->session_->GetSurfaceNode();
|
||||||
|
CHECK_NULL_VOID(surfaceNode);
|
||||||
|
surfaceNode->SetIsNotifyUIBufferAvailable(false);
|
||||||
|
auto host = self->GetHost();
|
||||||
|
CHECK_NULL_VOID(host);
|
||||||
|
self->AddChild(host, self->appWindow_, self->appWindowName_, 0);
|
||||||
|
host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE);
|
||||||
|
};
|
||||||
|
|
||||||
|
ContainerScope scope(instanceId_);
|
||||||
|
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||||
|
CHECK_NULL_VOID(pipelineContext);
|
||||||
|
pipelineContext->PostAsyncEvent(std::move(uiTask), "ArkUIWindowSceneOnForeground", TaskExecutor::TaskType::UI);
|
||||||
|
}
|
||||||
|
|
||||||
void WindowScene::OnBackground()
|
void WindowScene::OnBackground()
|
||||||
{
|
{
|
||||||
CHECK_NULL_VOID(session_);
|
CHECK_NULL_VOID(session_);
|
||||||
|
@ -44,6 +44,7 @@ protected:
|
|||||||
|
|
||||||
void OnActivation() override;
|
void OnActivation() override;
|
||||||
void OnConnect() override;
|
void OnConnect() override;
|
||||||
|
void OnForeground() override;
|
||||||
void OnBackground() override;
|
void OnBackground() override;
|
||||||
void OnDisconnect() override;
|
void OnDisconnect() override;
|
||||||
void OnDrawingCompleted() override;
|
void OnDrawingCompleted() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user