diff --git a/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp b/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp index febb0644e6971bfe0fd470b7323c002ceee9a4c3..e19212fa0175061c4011288f7318788c271a2ea5 100644 --- a/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp +++ b/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp @@ -226,6 +226,10 @@ bool SubwindowOhos::InitContainer() windowOption->SetWindowRect({ 0, 0, defaultDisplay->GetWidth(), defaultDisplay->GetHeight() }); windowOption->SetWindowMode(Rosen::WindowMode::WINDOW_MODE_FLOATING); SetUIExtensionSubwindowFlag(windowOption, isAppSubwindow, parentWindow); + auto displayId = parentWindow->GetDisplayId(); + TAG_LOGI(AceLogTag::ACE_SUB_WINDOW, + "The display id obtained from parent window is %{public}u", (uint32_t)displayId); + windowOption->SetDisplayId(displayId); window_ = OHOS::Rosen::Window::Create("ARK_APP_SUBWINDOW_" + windowTag + parentWindowName + std::to_string(windowId_), windowOption, parentWindow->GetContext()); if (!window_) {