diff -Nru kylin-process-manager-4.10.0.0/debian/changelog kylin-process-manager-4.10.0.0/debian/changelog --- kylin-process-manager-4.10.0.0/debian/changelog 2024-08-21 18:06:12.000000000 +0800 +++ kylin-process-manager-4.10.0.0/debian/changelog 2025-03-12 11:33:34.000000000 +0800 @@ -1,3 +1,21 @@ +kylin-process-manager (4.10.0.0-ok1.35) nile; urgency=medium + + * BUG: #292347 【分级冻结】系统资源紧张时,开启份即冻结弹窗会弹出多个 + * 需求: 无 + * 其他改动说明: 无 + * 其他改动影响域: 无 + + -- wangweinan <wangweinan@kylinos.cn> Wed, 12 Mar 2025 11:33:34 +0800 + +kylin-process-manager (4.10.0.0-ok1.34) nile; urgency=medium + + * BUG: #I9IZ13【通知中心】设置通知中关闭截图通知,按下截图仍有通知 + * 需求: 无 + * 其他改动说明: 无 + * 其他改动影响域: 无 + + -- wangweinan <wangweinan@kylinos.cn> Thu, 27 Feb 2025 15:28:54 +0800 + kylin-process-manager (4.10.0.0-ok1.33) nile; urgency=medium * BUG: #IADUHA 系统使用|任务栏分组逻辑有问题 diff -Nru kylin-process-manager-4.10.0.0/debian/patches/0030-debian-update-changelog-to-4.10.0.0-ok1.34.patch kylin-process-manager-4.10.0.0/debian/patches/0030-debian-update-changelog-to-4.10.0.0-ok1.34.patch --- kylin-process-manager-4.10.0.0/debian/patches/0030-debian-update-changelog-to-4.10.0.0-ok1.34.patch 1970-01-01 08:00:00.000000000 +0800 +++ kylin-process-manager-4.10.0.0/debian/patches/0030-debian-update-changelog-to-4.10.0.0-ok1.34.patch 2025-03-12 11:33:34.000000000 +0800 @@ -0,0 +1,131 @@ +From: Wei Wei <wangweinan@kylinos.cn> +Date: Thu, 27 Feb 2025 15:33:56 +0800 +Subject: debian: update changelog to 4.10.0.0-ok1.34 + +--- + core/appinfomanager.h | 2 +- + core/applaunchmanager.cpp | 4 ++++ + core/applaunchmanager.h | 2 ++ + core/desktopfilemanager.cpp | 19 ++++++++++++------- + core/desktopfilemanager.h | 9 +++++++-- + 5 files changed, 26 insertions(+), 10 deletions(-) + +diff --git a/core/appinfomanager.h b/core/appinfomanager.h +index e1a4c8e..f33b5d1 100644 +--- a/core/appinfomanager.h ++++ b/core/appinfomanager.h +@@ -115,7 +115,7 @@ private: + std::map<std::string, unsigned long long> m_appStateChangeTimerIds; + std::map<int, std::string> m_mprisServices; + std::vector<int> m_systemTrayIconApps; +- DesktopFileManager m_desktopFileManager; ++ DesktopFileManager &m_desktopFileManager = DesktopFileManager::instance(); + std::shared_ptr<ConfigManager> m_configManager; + + std::string m_currentActiveWid; +diff --git a/core/applaunchmanager.cpp b/core/applaunchmanager.cpp +index 670d059..adc98d5 100644 +--- a/core/applaunchmanager.cpp ++++ b/core/applaunchmanager.cpp +@@ -89,6 +89,10 @@ QStringList AppLaunchManager::GetAvailableAppListForFile(const QString &fileName + QString AppLaunchManager::GetDesktopFileByPid(int pid) + { + std::string desktopFile = m_processInfoManager.getDesktopFileByPid(pid); ++ // 当前进程可能未受到分级冻结管控 ++ if (desktopFile.empty()) { ++ desktopFile = m_desktopFileManager.syncGetDesktopFileByPid(pid); ++ } + return QString::fromStdString(desktopFile); + } + +diff --git a/core/applaunchmanager.h b/core/applaunchmanager.h +index a16c3cb..860f709 100644 +--- a/core/applaunchmanager.h ++++ b/core/applaunchmanager.h +@@ -23,6 +23,7 @@ + #include "applauncher.h" + #include "appchooser.h" + #include "processinfomanager.h" ++#include "desktopfilemanager.h" + + class AppLaunchManager : public QObject, public QDBusContext + { +@@ -51,6 +52,7 @@ private: + std::unique_ptr<AppLauncher> m_appLauncher; + ProcessInfoManager &m_processInfoManager; + AppChooser m_appChooser; ++ DesktopFileManager &m_desktopFileManager = DesktopFileManager::instance(); + }; + + #endif // APPLAUNCHMANAGER_H +diff --git a/core/desktopfilemanager.cpp b/core/desktopfilemanager.cpp +index 61bc69e..2a829db 100644 +--- a/core/desktopfilemanager.cpp ++++ b/core/desktopfilemanager.cpp +@@ -554,21 +554,26 @@ QString DesktopFileManager::findDesktopFileFromPid(int pid) + return QString(); + } + std::string environFile = "/proc/" + std::to_string(pid) + "/environ"; +- return readGioLaunchEnvironFromFile(environFile); ++ const QString gioDesktopFile = ++ readDesktopFileFromEnviron(environFile, "GIO_LAUNCHED_DESKTOP_FILE="); ++ if (gioDesktopFile.isEmpty()) { ++ return readDesktopFileFromEnviron(environFile, "PANSHI_APP_DESKTOP="); ++ } ++ ++ return gioDesktopFile; + } + +-QString DesktopFileManager::readGioLaunchEnvironFromFile(const std::string &file) +-{ +- std::ifstream processEnvironFile(file); ++QString DesktopFileManager::readDesktopFileFromEnviron( ++ const std::string &environFile, const QString &environName) { ++ std::ifstream processEnvironFile(environFile); + if (!processEnvironFile.is_open()) { + return QString(); + } + std::string line; +- std::string gioLaunchDesktopFileStr = "GIO_LAUNCHED_DESKTOP_FILE="; + while (std::getline(processEnvironFile, line, '\0')) { +- auto pos = line.find(gioLaunchDesktopFileStr); ++ auto pos = line.find(environName.toStdString()); + if (pos != std::string::npos) { +- line.erase(pos, gioLaunchDesktopFileStr.length()); ++ line.erase(pos, environName.length()); + return QString::fromStdString(line); + } + } +diff --git a/core/desktopfilemanager.h b/core/desktopfilemanager.h +index 3adb130..dc3005c 100644 +--- a/core/desktopfilemanager.h ++++ b/core/desktopfilemanager.h +@@ -26,13 +26,18 @@ class DesktopFileManager : public QObject + { + Q_OBJECT + public: +- explicit DesktopFileManager(QObject *parent = nullptr); ++ static DesktopFileManager &instance() { ++ static DesktopFileManager instance; ++ return instance; ++ } + + std::string syncGetDesktopFileByPid(int pid); + std::vector<std::string> desktopFilesWithName(const std::string &desktopName); + //todo: async + + private: ++ explicit DesktopFileManager(QObject *parent = nullptr); ++ + using FindDesktopFilePredicate = std::function<bool (std::tuple<QString, QStringList>)>; + using DesktopExecMap = QMap<QString, std::tuple<QString, QStringList>>; + +@@ -59,7 +64,7 @@ private: + QString bestDesktopFileFromMultDesktopFileLists(const QString &cmdline, const QStringList &desktopFileLists); + QString findDesktopFileByEqualStartArg(const QString &cmdline); + QString findDesktopFileFromPid(int pid); +- QString readGioLaunchEnvironFromFile(const std::string &file); ++ QString readDesktopFileFromEnviron(const std::string &environFile, const QString &environName); + DesktopExecMap standardPathDesktopFileExecMap(); + DesktopExecMap autoStartPathDesktopFileExecMap(); + diff -Nru kylin-process-manager-4.10.0.0/debian/patches/0031-debian-update-changelog-to-4.10.0.0-ok1.35.patch kylin-process-manager-4.10.0.0/debian/patches/0031-debian-update-changelog-to-4.10.0.0-ok1.35.patch --- kylin-process-manager-4.10.0.0/debian/patches/0031-debian-update-changelog-to-4.10.0.0-ok1.35.patch 1970-01-01 08:00:00.000000000 +0800 +++ kylin-process-manager-4.10.0.0/debian/patches/0031-debian-update-changelog-to-4.10.0.0-ok1.35.patch 2025-03-12 11:33:34.000000000 +0800 @@ -0,0 +1,179 @@ +From: Wei Wei <wangweinan@kylinos.cn> +Date: Wed, 12 Mar 2025 11:37:56 +0800 +Subject: debian: update changelog to 4.10.0.0-ok1.35 + +--- + base/notifydbusinterface.cpp | 36 +++++++++++++++++++++++++++++------- + base/notifydbusinterface.h | 4 ++-- + core/systemnotifiessender.cpp | 18 ++++++++++++++---- + core/systemnotifiessender.h | 1 + + 4 files changed, 46 insertions(+), 13 deletions(-) + +diff --git a/base/notifydbusinterface.cpp b/base/notifydbusinterface.cpp +index 9647dfd..f2caa3a 100644 +--- a/base/notifydbusinterface.cpp ++++ b/base/notifydbusinterface.cpp +@@ -49,16 +49,27 @@ void NotifyDBusInterface::initNotifyInterface() + qDebug() << "Create Notification service interface successful."; + } + +- initConnections(); ++ if (!initConnections()) { ++ qWarning() << "Connect notification service signals failed"; ++ delete m_notifyInterface; ++ m_notifyInterface = nullptr; ++ return; ++ } + } + +-void NotifyDBusInterface::initConnections() ++bool NotifyDBusInterface::initConnections() + { +- connect(m_notifyInterface, SIGNAL(NotificationClosed(uint,uint)), +- this, SLOT(handleNotifyClose(uint,uint))); ++ if (!connect(m_notifyInterface, SIGNAL(NotificationClosed(uint,uint)), ++ this, SLOT(handleNotifyClose(uint,uint)))) { ++ return false; ++ } + +- connect(m_notifyInterface, SIGNAL(ActionInvoked(uint,QString)), +- this, SLOT(handleActionInvoked(uint,QString))); ++ if (!connect(m_notifyInterface, SIGNAL(ActionInvoked(uint,QString)), ++ this, SLOT(handleActionInvoked(uint,QString)))) { ++ return false; ++ } ++ ++ return true; + } + + void NotifyDBusInterface::sendNotificationAsync( +@@ -70,6 +81,8 @@ void NotifyDBusInterface::sendNotificationAsync( + + if (!m_notifyInterface) { + qWarning() << "Init Notification service interface failed, can't send notification"; ++ if (callback) ++ callback(-1, false); + return; + } + } +@@ -84,6 +97,13 @@ void NotifyDBusInterface::sendNotificationAsync( + m_notifyInterface->asyncCall("Notify", app_name, replace, app_icon, + summary, body, actions, hints, + expire_timeout); ++ if (call.isError() || call.isValid()) { ++ qWarning() << "Send system notify failed:" ++ << call.error().name() << call.error().message(); ++ if (callback) ++ callback(-1, false); ++ return; ++ } + + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, +@@ -92,12 +112,14 @@ void NotifyDBusInterface::sendNotificationAsync( + if (reply.isError()) { + qWarning() << "Send system notify failed:" + << reply.error().name() << reply.error().message(); ++ if (callback) ++ callback(-1, false); + watcher->deleteLater(); + return; + } + + if (callback) { +- callback(reply.value()); ++ callback(reply.value(), true); + } + watcher->deleteLater(); + } +diff --git a/base/notifydbusinterface.h b/base/notifydbusinterface.h +index ff769cc..a90665a 100644 +--- a/base/notifydbusinterface.h ++++ b/base/notifydbusinterface.h +@@ -26,7 +26,7 @@ class NotifyDBusInterface : public QObject + public: + using NotifyCloseCallback = std::function<void(uint,uint)>; + using ActionInvokedCallback = std::function<void(uint,QString)>; +- using SendNotificationCallback = std::function<void(uint)>; ++ using SendNotificationCallback = std::function<void(uint,bool)>; + + explicit NotifyDBusInterface(QObject *parent = nullptr); + +@@ -43,7 +43,7 @@ private Q_SLOTS: + + private: + void initNotifyInterface(); +- void initConnections(); ++ bool initConnections(); + + QDBusInterface* m_notifyInterface; + std::vector<NotifyCloseCallback> m_notifyCloseCallbacks; +diff --git a/core/systemnotifiessender.cpp b/core/systemnotifiessender.cpp +index 017d718..0a34098 100644 +--- a/core/systemnotifiessender.cpp ++++ b/core/systemnotifiessender.cpp +@@ -27,6 +27,7 @@ SystemNotifiesSender::SystemNotifiesSender(std::shared_ptr<ConfigManager> config + , m_notifyDBusInterface(new NotifyDBusInterface) + , m_notifyTimer(new QTimer) + , m_resourceWarningNotifyId(0) ++ , m_hasSendNotification(false) + { + m_notifyTimer->setSingleShot(true); + initConnections(); +@@ -49,7 +50,8 @@ void SystemNotifiesSender::handleResourceWarningNotifyClose(uint notifyId, uint + qDebug() << "Receive NotifyClose signal from notify:" << notifyId << reason; + + m_resourceWarningNotifyId = 0; +- m_notifyTimer->start(60000); // after close notify, no more repeated notify within 60s. ++ m_hasSendNotification = false; ++ m_notifyTimer->start(60000); // after close notify, no more repeated notify within 60s. + } + + void SystemNotifiesSender::handleResourceWarningActionInvoked(uint notifyId, const std::string &actionKey) +@@ -61,12 +63,14 @@ void SystemNotifiesSender::handleResourceWarningActionInvoked(uint notifyId, con + if (actionKey == enable_reousrce_limit_key) { + m_configManager->setReousrceLimitEnabled(true); + m_resourceWarningNotifyId = 0; ++ m_hasSendNotification = false; + } + } + + void SystemNotifiesSender::sendResourceWarningNotify() + { +- if (m_resourceWarningNotifyId != 0) ++ // 发送请求后不一定会立刻被处理,避免重复发送请求 ++ if (m_hasSendNotification) + return; + if (m_notifyTimer->isActive()) { + qDebug() << "Just close notify," << m_notifyTimer->remainingTime() << "after repeate."; +@@ -80,10 +84,16 @@ void SystemNotifiesSender::sendResourceWarningNotify() + const QVariantMap hints = {{QString("urgency"), QVariant::fromValue(QString("2"))}, + {QString("x-ukui-popup-timeout"), QVariant::fromValue(-1)}}; + +- auto sendNotifyCallback = [this](uint notifyId) { +- qDebug() << "Send notify:" << notifyId; ++ auto sendNotifyCallback = [this](uint notifyId, bool successful) { ++ if (!successful) { ++ qWarning() << "Send notification error."; ++ m_hasSendNotification = false; ++ return; ++ } ++ qDebug() << "Send notification:" << notifyId; + m_resourceWarningNotifyId = notifyId; + }; ++ m_hasSendNotification = true; + m_notifyDBusInterface->sendNotificationAsync(summary, body, actions, hints, + 0, sendNotifyCallback); + } +diff --git a/core/systemnotifiessender.h b/core/systemnotifiessender.h +index 6fa74c3..d122c8f 100644 +--- a/core/systemnotifiessender.h ++++ b/core/systemnotifiessender.h +@@ -40,6 +40,7 @@ private: + std::unique_ptr<NotifyDBusInterface> m_notifyDBusInterface; + std::unique_ptr<QTimer> m_notifyTimer; + uint m_resourceWarningNotifyId; ++ bool m_hasSendNotification; + }; + + #endif // SYSTEMNOTIFIESSENDER_H diff -Nru kylin-process-manager-4.10.0.0/debian/patches/series kylin-process-manager-4.10.0.0/debian/patches/series --- kylin-process-manager-4.10.0.0/debian/patches/series 2024-08-21 18:06:12.000000000 +0800 +++ kylin-process-manager-4.10.0.0/debian/patches/series 2025-03-12 11:33:34.000000000 +0800 @@ -27,3 +27,5 @@ 0027-debian-update-changelog-to-4.10.0.0-ok1.31.patch 0028-build-update-changelog.patch 0029-build-update-changelog.patch +0030-debian-update-changelog-to-4.10.0.0-ok1.34.patch +0031-debian-update-changelog-to-4.10.0.0-ok1.35.patch