From 5f36df44304ee97728c83f7c80268898a2672a39 Mon Sep 17 00:00:00 2001 From: chengbo Date: Thu, 29 Oct 2020 18:08:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=BB=E5=8A=A1=E6=A0=8F=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4=E5=B7=A6=E8=BE=B9=EF=BC=8C=E6=91=A9?= =?UTF-8?q?=E7=81=AF=E7=AA=97=E5=8F=A3=E8=BF=98=E6=98=AF=E4=BB=8E=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除定时器,使用监听Dock的FrontendWindowRect change信号,重新更新IconGeometries Log: 魔灯效果下,窗口效果跟随任务栏位置 Bug: https://pms.uniontech.com/zentao/bug-view-44736.html Change-Id: I5e6caf7872dc37c34d8e5fb99676d7b35940dff3 --- frame/controller/dockitemmanager.cpp | 2 ++ frame/controller/dockitemmanager.h | 2 ++ frame/item/appitem.cpp | 2 ++ frame/item/appitem.h | 2 ++ frame/util/multiscreenworker.cpp | 1 + frame/util/multiscreenworker.h | 2 ++ frame/window/mainwindow.cpp | 2 ++ 7 files changed, 13 insertions(+) diff --git a/frame/controller/dockitemmanager.cpp b/frame/controller/dockitemmanager.cpp index 1fc483664..1ca1fea36 100644 --- a/frame/controller/dockitemmanager.cpp +++ b/frame/controller/dockitemmanager.cpp @@ -48,6 +48,8 @@ DockItemManager::DockItemManager(QObject *parent) connect(it, &AppItem::requestPreviewWindow, m_appInter, &DBusDock::PreviewWindow); connect(it, &AppItem::requestCancelPreview, m_appInter, &DBusDock::CancelPreviewWindow); + connect(this, &DockItemManager::requestUpdateDockItem, it, &AppItem::requestUpdateEntryGeometries); + m_itemList.append(it); } diff --git a/frame/controller/dockitemmanager.h b/frame/controller/dockitemmanager.h index e74c4fb16..d545b36ec 100644 --- a/frame/controller/dockitemmanager.h +++ b/frame/controller/dockitemmanager.h @@ -54,6 +54,8 @@ signals: void requestWindowAutoHide(const bool autoHide) const; void requestRefershWindowVisible() const; + void requestUpdateDockItem() const; + public slots: void refershItemsIcon(); void sortPluginItems(); diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index a05127613..0ea4e297b 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -116,6 +116,8 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) connect(m_updateIconGeometryTimer, &QTimer::timeout, this, &AppItem::updateWindowIconGeometries, Qt::QueuedConnection); connect(m_retryObtainIconTimer, &QTimer::timeout, this, &AppItem::refershIcon, Qt::QueuedConnection); + connect(this, &AppItem::requestUpdateEntryGeometries, this, &AppItem::updateWindowIconGeometries); + updateWindowInfos(m_itemEntryInter->windowInfos()); refershIcon(); diff --git a/frame/item/appitem.h b/frame/item/appitem.h index a414125e4..104c11211 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -63,6 +63,8 @@ signals: void requestCancelPreview() const; void dragReady(QWidget *dragWidget); + void requestUpdateEntryGeometries() const; + private: void moveEvent(QMoveEvent *e) override; void paintEvent(QPaintEvent *e) override; diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index 9e599fcbe..fb7db1c4a 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -722,6 +722,7 @@ void MultiScreenWorker::onRequestUpdateFrontendGeometry() #endif m_dockInter->SetFrontendWindowRect(int(rect.x()), int(rect.y()), uint(rect.width()), uint(rect.height())); + emit requestUpdateDockEntry(); } void MultiScreenWorker::onRequestNotifyWindowManager() diff --git a/frame/util/multiscreenworker.h b/frame/util/multiscreenworker.h index 008fef6bd..c89ab2f99 100644 --- a/frame/util/multiscreenworker.h +++ b/frame/util/multiscreenworker.h @@ -287,6 +287,8 @@ signals: void requestStopShowAni(); void requestStopHideAni(); + void requestUpdateDockEntry(); + public slots: void onAutoHideChanged(bool autoHide); /** diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index 23f53bb1c..fec18469f 100755 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -296,6 +296,8 @@ void MainWindow::initConnections() connect(m_multiScreenWorker, &MultiScreenWorker::opacityChanged, this, &MainWindow::setMaskAlpha, Qt::QueuedConnection); connect(m_multiScreenWorker, &MultiScreenWorker::displayModeChanegd, this, &MainWindow::adjustShadowMask, Qt::QueuedConnection); + connect(m_multiScreenWorker, &MultiScreenWorker::requestUpdateDockEntry, DockItemManager::instance(), &DockItemManager::requestUpdateDockItem); + // 更新拖拽区域 connect(m_multiScreenWorker, &MultiScreenWorker::requestUpdateDragArea, this, &MainWindow::resetDragWindow);