File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments