fix expand screen bug

Signed-off-by: youqijing <youqijing@huawei.com>
Change-Id: Ieae48a618896ab0b48b2dc9b41ef4b300dc75a62
This commit is contained in:
youqijing
2022-02-16 11:59:51 +08:00
parent 000116e3bb
commit 7dceacfbb2
3 changed files with 11 additions and 12 deletions
+2 -1
View File
@@ -184,9 +184,10 @@ void AbstractDisplayController::ProcessExpandScreenDisconnected(
", screenId: %{public}" PRIu64"", displayId, abstractDisplay->GetAbstractScreenId());
// Notify disconnect event to WMS
DisplayManagerService::GetInstance().NotifyDisplayStateChange(displayId, DisplayStateChangeType::DESTROY);
abstractDisplayMap_.erase(iter);
// Notify disconnect event to DisplayManager
DisplayManagerAgentController::GetInstance().OnDisplayDestroy(abstractDisplay->GetId());
abstractDisplayMap_.erase(iter);
break;
}
}
+4 -4
View File
@@ -257,6 +257,10 @@ void WindowController::NotifyDisplayStateChange(DisplayId displayId, DisplayStat
ProcessDisplayChange(displayId, type);
break;
}
case DisplayStateChangeType::DESTROY: {
windowRoot_->NotifyDisplayDestory(displayId);
break;
}
default: {
WLOGFE("unknown DisplayStateChangeType:%{public}u", type);
return;
@@ -292,10 +296,6 @@ void WindowController::ProcessDisplayChange(DisplayId displayId, DisplayStateCha
WLOGFI("display w/h: %{public}u %{public}u", abstractDisplay->GetWidth(), abstractDisplay->GetHeight());
break;
}
case DisplayStateChangeType::DESTROY: {
windowRoot_->NotifyDisplayDestory(displayId);
break;
}
default: {
WLOGFE("unknown DisplayStateChangeType:%{public}u", type);
return;
+5 -7
View File
@@ -970,25 +970,23 @@ void WindowNodeContainer::RaiseInputMethodWindowPriorityIfNeeded(const sptr<Wind
void WindowNodeContainer::MoveWindowNode(sptr<WindowNodeContainer>& container)
{
WLOGFI("MoveWindowNode: disconnect expand display, move window node");
WLOGFI("MoveWindowNode: disconnect expand display: %{public}" PRId64 ", move window node to display: "
"%{public}" PRId64 "", container->GetDisplayId(), displayId_);
sptr<WindowNode> belowAppNode = container->GetBelowAppWindowNode();
sptr<WindowNode> appNode = container->GetAppWindowNode();
sptr<WindowNode> aboveAppNode = container->GetAboveAppWindowNode();
for (auto& node : belowAppNode->children_) {
WLOGFI("belowAppWindowNode_: move windowNode: {public}%d from displayId: %{public}" PRId64 ""
" to displayID %{public}" PRId64 "", node->GetWindowId(), node->GetDisplayId(), displayId_);
WLOGFI("belowAppWindowNode_: move windowNode: {public}%d", node->GetWindowId());
node->SetDisplayId(displayId_);
belowAppWindowNode_->children_.push_back(node);
}
for (auto& node : appNode->children_) {
WLOGFI("appWindowNode_: move windowNode: {public}%d from displayId: %{public}" PRId64 ""
" to displayID %{public}" PRId64 "", node->GetWindowId(), node->GetDisplayId(), displayId_);
WLOGFI("appWindowNode_: move windowNode: {public}%d", node->GetWindowId());
node->SetDisplayId(displayId_);
appWindowNode_->children_.push_back(node);
}
for (auto& node : aboveAppNode->children_) {
WLOGFI("aboveAppWindowNode_: move windowNode: {public}%d from displayId: %{public}" PRId64 ""
" to displayID %{public}" PRId64 "", node->GetWindowId(), node->GetDisplayId(), displayId_);
WLOGFI("aboveAppWindowNode_: move windowNode: {public}%d", node->GetWindowId());
node->SetDisplayId(displayId_);
aboveAppWindowNode_->children_.push_back(node);
}