diff --git a/frame/window/mainpanelcontrol.cpp b/frame/window/mainpanelcontrol.cpp index efc6531a8..c6f6df6d7 100755 --- a/frame/window/mainpanelcontrol.cpp +++ b/frame/window/mainpanelcontrol.cpp @@ -1255,6 +1255,7 @@ void MainPanelControl::resizeDockIcon() iconSize = (totalLength - yu) / iconCount; } + iconSize = iconSize / qApp->devicePixelRatio(); if ((m_position == Position::Top) || (m_position == Position::Bottom)) { if (iconSize >= height()) { calcuDockIconSize(height(), height(), tray_item_size); diff --git a/frame/window/windowmanager.cpp b/frame/window/windowmanager.cpp index 71f5480d6..775c2c60d 100644 --- a/frame/window/windowmanager.cpp +++ b/frame/window/windowmanager.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -676,8 +677,18 @@ void WindowManager::onRequestUpdateFrontendGeometry() if (rect.width() == 0 || rect.height() == 0) return; + int x = rect.x(); + int y = rect.y(); + QScreen *screen = DIS_INS->screen(DOCKSCREEN_INS->current()); + if (screen) { + if (m_position == Dock::Position::Top || m_position == Dock::Position::Bottom) + x = (screen->handle()->geometry().width() - (rect.width() * qApp->devicePixelRatio())) / 2; + else + y = (screen->handle()->geometry().height() - (rect.height() * qApp->devicePixelRatio())) / 2; + } + DockInter dockInter(dockServiceName(), dockServicePath(), QDBusConnection::sessionBus()); - dockInter.SetFrontendWindowRect(int(rect.x()), int(rect.y()), uint(rect.width()), uint(rect.height())); + dockInter.SetFrontendWindowRect(x, y, uint(rect.width()), uint(rect.height())); } void WindowManager::onRequestNotifyWindowManager()