Skip to content

Commit 853536e

Browse files
wangrong1069deepin-bot[bot]
authored andcommitted
feat: Adapt to V23 dde dbus interface
As title. Log: Adapt to V23 dde dbus interface
1 parent 1f4316e commit 853536e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/source/common/dbusadpator.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,17 @@ void ApplicationAdaptor::onActiveWindow(qint64 pid)
7272
qInfo() << "activateWindow by Dock dbus";
7373
QDBusInterface dockDbusInterfaceV20(
7474
"com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", "com.deepin.dde.daemon.Dock");
75-
if (dockDbusInterfaceV20.isValid()) {
76-
QDBusReply<void> reply = dockDbusInterfaceV20.call("ActivateWindow", m_curShowWidget->winId());
77-
if (!reply.isValid()) {
78-
qWarning() << qPrintable("Call v20 com.deepin.dde.daemon.Dock failed") << reply.error();
79-
} else {
80-
qInfo() << "Dock dbus activateWindow success!";
81-
}
75+
QDBusInterface dockDbusInterfaceV23(
76+
"org.deepin.dde.daemon.Dock1", "/org/deepin/dde/daemon/Dock1", "org.deepin.dde.daemon.Dock1");
77+
QDBusInterface *dockDbusInterface = dockDbusInterfaceV23.isValid() ? &dockDbusInterfaceV23 : &dockDbusInterfaceV20;
78+
if (dockDbusInterface->isValid()) {
79+
QDBusReply<void> reply = dockDbusInterface->call("ActivateWindow", m_curShowWidget->winId());
80+
if (!reply.isValid()) {
81+
qWarning() << "Dock dbus activateWindow failed via" << dockDbusInterface->service() << ", error:" << reply.error();
82+
} else {
83+
qInfo() << "Dock dbus activateWindow success!";
8284
}
85+
}
8386
}
8487

8588
}

0 commit comments

Comments
 (0)