!38647 前台通知删除截图

Merge pull request !38647 from yuanxiaojie/master
This commit is contained in:
openharmony_ci 2024-07-26 01:23:33 +00:00 committed by Gitee
commit dc595580d4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 27 additions and 0 deletions

View File

@ -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_);

View File

@ -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;