diff --git a/frameworks/wm/src/server/layer_controller.cpp b/frameworks/wm/src/server/layer_controller.cpp index 2dcc3b0066..89db5cce91 100644 --- a/frameworks/wm/src/server/layer_controller.cpp +++ b/frameworks/wm/src/server/layer_controller.cpp @@ -178,12 +178,12 @@ void LayerController::ChangeWindowTop(uint32_t id) } std::list sameTypeWinList; - sameTypeWinList.push_back(id); for (auto it = m_windowList.begin(); it != m_windowList.end(); it++) { if (it->windowType == topwininfo->windowType && it->windowId != id) { sameTypeWinList.push_back(it->windowId); } } + sameTypeWinList.push_back(id); const int renderSize = sameTypeWinList.size(); auto renderOrder = std::make_unique(renderSize);