mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: dock get stucked when launching
org.ayatana.bamf dbus will get into stucked, so only call it when it's ready log: only call org.ayatana.bamf when it's ready issue: https://github.com/linuxdeepin/developer-center/issues/6657
This commit is contained in:
parent
a222173da6
commit
31e149d3d2
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <qstandardpaths.h>
|
#include <QDBusConnection>
|
||||||
|
|
||||||
#define XCB XCBUtils::instance()
|
#define XCB XCBUtils::instance()
|
||||||
|
|
||||||
@ -74,11 +74,28 @@ WindowIdentify::WindowIdentify(TaskManager *_taskmanager, QObject *parent)
|
|||||||
m_identifyWindowFuns << qMakePair(QString("FlatpakAppID"), &identifyWindowByFlatpakAppID);
|
m_identifyWindowFuns << qMakePair(QString("FlatpakAppID"), &identifyWindowByFlatpakAppID);
|
||||||
m_identifyWindowFuns << qMakePair(QString("CrxId"), &identifyWindowByCrxId);
|
m_identifyWindowFuns << qMakePair(QString("CrxId"), &identifyWindowByCrxId);
|
||||||
m_identifyWindowFuns << qMakePair(QString("Rule"), &identifyWindowByRule);
|
m_identifyWindowFuns << qMakePair(QString("Rule"), &identifyWindowByRule);
|
||||||
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
|
||||||
m_identifyWindowFuns << qMakePair(QString("Pid"), &identifyWindowByPid);
|
m_identifyWindowFuns << qMakePair(QString("Pid"), &identifyWindowByPid);
|
||||||
m_identifyWindowFuns << qMakePair(QString("Scratch"), &identifyWindowByScratch);
|
m_identifyWindowFuns << qMakePair(QString("Scratch"), &identifyWindowByScratch);
|
||||||
m_identifyWindowFuns << qMakePair(QString("GtkAppId"), &identifyWindowByGtkAppId);
|
m_identifyWindowFuns << qMakePair(QString("GtkAppId"), &identifyWindowByGtkAppId);
|
||||||
m_identifyWindowFuns << qMakePair(QString("WmClass"), &identifyWindowByWmClass);
|
m_identifyWindowFuns << qMakePair(QString("WmClass"), &identifyWindowByWmClass);
|
||||||
|
|
||||||
|
// should remove bamf identify and turn to new AM
|
||||||
|
auto *dbusWatcher = new QDBusServiceWatcher(QStringLiteral("org.ayatana.bamf"), QDBusConnection::sessionBus(),
|
||||||
|
QDBusServiceWatcher::WatchForOwnerChange, this);
|
||||||
|
|
||||||
|
auto ifc = QDBusConnection::sessionBus().interface();
|
||||||
|
|
||||||
|
if (ifc->isServiceRegistered(QStringLiteral("org.ayatana.bamf"))) {
|
||||||
|
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(dbusWatcher, &QDBusServiceWatcher::serviceRegistered, this, [this](){
|
||||||
|
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(dbusWatcher, &QDBusServiceWatcher::serviceUnregistered, this, [this](){
|
||||||
|
m_identifyWindowFuns.removeAll(qMakePair(QString("Bamf"), &identifyWindowByBamf));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AppInfo *WindowIdentify::identifyWindow(WindowInfoBase *winInfo, QString &innerId)
|
AppInfo *WindowIdentify::identifyWindow(WindowInfoBase *winInfo, QString &innerId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user