diff --git a/wmserver/include/window_root.h b/wmserver/include/window_root.h index 53912074..b914260b 100644 --- a/wmserver/include/window_root.h +++ b/wmserver/include/window_root.h @@ -41,6 +41,7 @@ public: sptr GetWindowNodeContainer(DisplayId displayId); sptr CreateWindowNodeContainer(sptr displayInfo); sptr GetWindowNode(uint32_t windowId) const; + void GetBackgroundNodesByScreenId(ScreenId screenGroupId, std::vector>& windowNodes) const; WMError SaveWindow(const sptr& node); void AddDeathRecipient(sptr node); @@ -84,7 +85,7 @@ public: void SetBrightness(uint32_t windowId, float brightness); void HandleKeepScreenOn(uint32_t windowId, bool requireLock); void UpdateFocusableProperty(uint32_t windowId); - void SetMaxAppWindowNumber(int windowNum); + void SetMaxAppWindowNumber(uint32_t windowNum); WMError GetModeChangeHotZones(DisplayId displayId, ModeChangeHotZones& hotZones, const ModeChangeHotZonesConfig& config); std::vector GetAllDisplayIds() const; @@ -100,6 +101,7 @@ public: sptr FindDialogCallerNode(WindowType type, sptr token); bool CheckMultiDialogWindows(WindowType type, sptr token); bool HasPrivateWindow(DisplayId displayId); + private: void OnRemoteDied(const sptr& remoteObject); WMError DestroyWindowInner(sptr& node); diff --git a/wmserver/src/window_dumper.cpp b/wmserver/src/window_dumper.cpp index f1fe6015..6115d4fd 100644 --- a/wmserver/src/window_dumper.cpp +++ b/wmserver/src/window_dumper.cpp @@ -88,8 +88,15 @@ WMError WindowDumper::DumpScreenGroupWindowInfo(ScreenId screenGroupId, << std::endl; std::vector> windowNodes; windowNodeContainer->TraverseContainer(windowNodes); - uint32_t zOrder = windowNodes.size(); + int zOrder = windowNodes.size(); + windowRoot_->GetBackgroundNodesByScreenId(screenGroupId, windowNodes); for (auto& windowNode : windowNodes) { + if (zOrder < 0) { + zOrder = 0; + } else if (zOrder == 0) { + oss << "---------------------------------------------------------------------------------------" + << std::endl; + } if (windowNode == nullptr) { --zOrder; break; diff --git a/wmserver/src/window_root.cpp b/wmserver/src/window_root.cpp index 6b7016c4..85a03bab 100644 --- a/wmserver/src/window_root.cpp +++ b/wmserver/src/window_root.cpp @@ -144,6 +144,16 @@ sptr WindowRoot::GetWindowNode(uint32_t windowId) const return iter->second; } +void WindowRoot::GetBackgroundNodesByScreenId(ScreenId screenGroupId, std::vector>& windowNodes) const +{ + for (const auto& it : windowNodeMap_) { + if (it.second && screenGroupId == DisplayManagerServiceInner::GetInstance().GetScreenGroupIdByDisplayId( + it.second->GetDisplayId()) && !it.second->currentVisibility_) { + windowNodes.push_back(it.second); + } + } +} + sptr WindowRoot::FindWindowNodeWithToken(const sptr& token) const { if (token == nullptr) { @@ -1308,7 +1318,7 @@ bool WindowRoot::HasPrivateWindow(DisplayId displayId) return container != nullptr ? container->HasPrivateWindow() : false; } -void WindowRoot::SetMaxAppWindowNumber(int windowNum) +void WindowRoot::SetMaxAppWindowNumber(uint32_t windowNum) { maxAppWindowNumber_ = windowNum; }