diff --git a/frame/controller/dockitemmanager.cpp b/frame/controller/dockitemmanager.cpp index 45f0628fb..fe620151b 100644 --- a/frame/controller/dockitemmanager.cpp +++ b/frame/controller/dockitemmanager.cpp @@ -189,6 +189,12 @@ void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index) } AppItem *item = new AppItem(path); + + if (m_appIDist.contains(item->appId())) { + delete item; + return; + } + manageItem(item); connect(item, &AppItem::requestActivateWindow, m_appInter, &DBusDock::ActivateWindow, Qt::QueuedConnection); @@ -196,6 +202,7 @@ void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index) connect(item, &AppItem::requestCancelPreview, m_appInter, &DBusDock::CancelPreviewWindow); m_itemList.insert(insertIndex, item); + m_appIDist.append(item->appId()); if (index != -1) { emit itemInserted(insertIndex - 1, item); @@ -219,6 +226,8 @@ void DockItemManager::appItemRemoved(const QString &appId) appItemRemoved(app); } } + + m_appIDist.removeAll(appId); } void DockItemManager::appItemRemoved(AppItem *appItem) diff --git a/frame/controller/dockitemmanager.h b/frame/controller/dockitemmanager.h index 37b45352d..e74c4fb16 100644 --- a/frame/controller/dockitemmanager.h +++ b/frame/controller/dockitemmanager.h @@ -79,6 +79,7 @@ private: static DockItemManager *INSTANCE; QList> m_itemList; + QList m_appIDist; }; #endif // DOCKITEMMANAGER_H diff --git a/frame/item/components/previewcontainer.cpp b/frame/item/components/previewcontainer.cpp index a2d5ed807..042b4637d 100644 --- a/frame/item/components/previewcontainer.cpp +++ b/frame/item/components/previewcontainer.cpp @@ -224,7 +224,6 @@ void PreviewContainer::onSnapshotClicked(const WId wid) Q_EMIT requestActivateWindow(wid); m_needActivate = true; m_waitForShowPreviewTimer->stop(); - requestCancelPreviewWindow(); requestHidePopup(); } @@ -248,8 +247,6 @@ void PreviewContainer::previewEntered(const WId wid) m_floatingPreview->trackWindow(snap); - requestCancelPreviewWindow(); - if (m_waitForShowPreviewTimer->isActive()) { return; } diff --git a/frame/panel/mainpanelcontrol.cpp b/frame/panel/mainpanelcontrol.cpp index 18a955f30..b3308586f 100755 --- a/frame/panel/mainpanelcontrol.cpp +++ b/frame/panel/mainpanelcontrol.cpp @@ -311,7 +311,6 @@ void MainPanelControl::updateAppAreaSonWidgetSize() m_appAreaSonWidget->adjustSize(); moveAppSonWidget(); - updateFixedAreaIcon(); } void MainPanelControl::setPositonValue(Dock::Position position) @@ -567,7 +566,6 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event) if (event->type() == QEvent::LayoutRequest) { m_appAreaSonWidget->adjustSize(); resizeDockIcon(); - updateFixedAreaIcon(); } else { moveAppSonWidget(); } @@ -1118,22 +1116,6 @@ void MainPanelControl::resizeDesktopWidget() m_desktopWidget->setFixedSize(0, 0); } -void MainPanelControl::updateFixedAreaIcon() -{ - QLayoutItem *appLayoutItem = m_appAreaSonLayout->itemAt(0); - if (appLayoutItem) { - QWidget *appWidget = appLayoutItem->widget(); - if (appWidget) { - int w = appWidget->width(); - int h = appWidget->height(); - for (int i = 0; i < m_fixedAreaLayout->count(); ++ i) { - // 取最近较小偶数, 去抖 - m_fixedAreaLayout->itemAt(i)->widget()->setFixedSize((w | 1) - 1, (h | 1) - 1); - } - } - } -} - /** * @brief MainPanelControl::checkNeedShowDesktop 根据窗管提供接口(当前是否显示的桌面),提供鼠标 * 移入 显示桌面窗口 区域时,是否需要显示桌面判断依据 diff --git a/frame/panel/mainpanelcontrol.h b/frame/panel/mainpanelcontrol.h index 6f2b07d13..75c79d078 100755 --- a/frame/panel/mainpanelcontrol.h +++ b/frame/panel/mainpanelcontrol.h @@ -104,9 +104,8 @@ private: void resizeDockIcon(); void calcuDockIconSize(int w, int h, PluginsItem *trashPlugin, PluginsItem *shutdownPlugin, PluginsItem *keyboardPlugin, PluginsItem *notificationPlugin); void resizeDesktopWidget(); - - void updateFixedAreaIcon(); bool checkNeedShowDesktop(); + public slots: void insertItem(const int index, DockItem *item); void removeItem(DockItem *item); diff --git a/plugins/datetime/datetimeplugin.cpp b/plugins/datetime/datetimeplugin.cpp index 3306ca7a0..4183293db 100644 --- a/plugins/datetime/datetimeplugin.cpp +++ b/plugins/datetime/datetimeplugin.cpp @@ -59,8 +59,8 @@ void DatetimePlugin::init(PluginProxyInterface *proxyInter) QSettings settings("deepin", "dde-dock-datetime"); if (QFile::exists(settings.fileName())) { Dock::DisplayMode mode = displayMode(); - const QString key = QString("pos_%1").arg(mode); - proxyInter->saveValue(this, key, settings.value(key, mode == Dock::DisplayMode::Fashion ? 5 : -1)); + const QString key = QString("pos_%1_%2").arg(pluginName()).arg(mode); + proxyInter->saveValue(this, key, settings.value(key, mode == Dock::DisplayMode::Fashion ? 6 : -1)); QFile::remove(settings.fileName()); } @@ -110,15 +110,15 @@ int DatetimePlugin::itemSortKey(const QString &itemKey) { Q_UNUSED(itemKey); - const QString key = QString("pos_%1").arg(Dock::Efficient); - return m_proxyInter->getValue(this, key, 5).toInt(); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 6).toInt(); } void DatetimePlugin::setSortKey(const QString &itemKey, const int order) { Q_UNUSED(itemKey); - const QString key = QString("pos_%1").arg(Dock::Efficient); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/keyboard-layout/keyboardplugin.cpp b/plugins/keyboard-layout/keyboardplugin.cpp index 26d86d625..665c41554 100644 --- a/plugins/keyboard-layout/keyboardplugin.cpp +++ b/plugins/keyboard-layout/keyboardplugin.cpp @@ -77,3 +77,17 @@ QWidget *KeyboardPlugin::itemTipsWidget(const QString &itemKey) return nullptr; } + +int KeyboardPlugin::itemSortKey(const QString &itemKey) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + + return m_proxyInter->getValue(this, key, 2).toInt(); +} + +void KeyboardPlugin::setSortKey(const QString &itemKey, const int order) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + + m_proxyInter->saveValue(this, key, order); +} diff --git a/plugins/keyboard-layout/keyboardplugin.h b/plugins/keyboard-layout/keyboardplugin.h index 62a44f24a..30cb754c9 100644 --- a/plugins/keyboard-layout/keyboardplugin.h +++ b/plugins/keyboard-layout/keyboardplugin.h @@ -40,6 +40,9 @@ public: QWidget *itemWidget(const QString &itemKey) override; QWidget *itemTipsWidget(const QString &itemKey) override; + int itemSortKey(const QString &itemKey) override; + void setSortKey(const QString &itemKey, const int order) override; + private: DBusAdaptors *m_dbusAdaptors = nullptr; }; diff --git a/plugins/shutdown/shutdownplugin.cpp b/plugins/shutdown/shutdownplugin.cpp index 8d3d3a965..38371f911 100644 --- a/plugins/shutdown/shutdownplugin.cpp +++ b/plugins/shutdown/shutdownplugin.cpp @@ -216,7 +216,7 @@ void ShutdownPlugin::displayModeChanged(const Dock::DisplayMode displayMode) int ShutdownPlugin::itemSortKey(const QString &itemKey) { const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); - return m_proxyInter->getValue(this, key, 6).toInt(); + return m_proxyInter->getValue(this, key, 5).toInt(); } void ShutdownPlugin::setSortKey(const QString &itemKey, const int order) diff --git a/plugins/sound/soundapplet.cpp b/plugins/sound/soundapplet.cpp index 95c280dd7..536c748d7 100644 --- a/plugins/sound/soundapplet.cpp +++ b/plugins/sound/soundapplet.cpp @@ -369,8 +369,7 @@ void SoundApplet::toggleMute() void SoundApplet::onPlaySoundEffect() { - // set the mute property to false to play sound effects. - m_defSinkInter->SetMuteQueued(false); + } void SoundApplet::increaseVolumeChanged() diff --git a/plugins/tray/fashiontray/containers/abstractcontainer.cpp b/plugins/tray/fashiontray/containers/abstractcontainer.cpp index 72a7f23cb..a07996198 100644 --- a/plugins/tray/fashiontray/containers/abstractcontainer.cpp +++ b/plugins/tray/fashiontray/containers/abstractcontainer.cpp @@ -293,9 +293,6 @@ int AbstractContainer::whereToInsert(FashionTrayWidgetWrapper *wrapper) return m_wrapperList.size(); } - if (wrapper->absTrayWidget()->trayTyep() == AbstractTrayWidget::TrayType::SystemTray) - destSortKey += m_wrapperList.size(); - // 当目标插入位置为列表的大小时将从最后面追加到列表中 int destIndex = m_wrapperList.size(); for (int i = 0; i < m_wrapperList.size(); ++i) { diff --git a/plugins/tray/system-trays/systemtrayitem.cpp b/plugins/tray/system-trays/systemtrayitem.cpp index 842cc5e0a..bba912445 100644 --- a/plugins/tray/system-trays/systemtrayitem.cpp +++ b/plugins/tray/system-trays/systemtrayitem.cpp @@ -140,6 +140,7 @@ QWidget *SystemTrayItem::trayTipsWidget() if (m_pluginInter->itemTipsWidget(m_itemKey)) { m_pluginInter->itemTipsWidget(m_itemKey)->setAccessibleName(m_pluginInter->pluginName()); } + return m_pluginInter->itemTipsWidget(m_itemKey); } @@ -148,6 +149,7 @@ QWidget *SystemTrayItem::trayPopupApplet() if (m_pluginInter->itemPopupApplet(m_itemKey)) { m_pluginInter->itemPopupApplet(m_itemKey)->setAccessibleName(m_pluginInter->pluginName()); } + return m_pluginInter->itemPopupApplet(m_itemKey); }