mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-05-30 22:01:41 +00:00
fix: 修改v20的接口为v23的接口
将所有用到的com.deepin相关的接口改成org.deepin相关的接口 Log: Influence: 打开控制中心,鼠标移动唤醒任务栏等操作 Task: https://pms.uniontech.com/task-view-182009.html Change-Id: I3c56dfaa0e95d03fc75468e0a7a5d2ce217a6e63
This commit is contained in:
parent
282e933225
commit
29647bf7a1
@ -452,7 +452,7 @@ void AppDragWidget::initWaylandEnv()
|
||||
|
||||
// 由于在wayland环境下无法触发drop事件,导致鼠标无法释放,所以这里暂时用XEventMonitor的方式(具体原因待查)
|
||||
Dock::Position position = qApp->property(PROP_POSITION).value<Dock::Position>();
|
||||
XEventMonitor *extralEventInter = new XEventMonitor("com.deepin.api.XEventMonitor", "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus());
|
||||
XEventMonitor *extralEventInter = new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus());
|
||||
QList<MonitRect> extralRectList;
|
||||
QList<QScreen *> screens = DisplayManager::instance()->screens();
|
||||
for (QScreen *screen : screens) {
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "themeappicon.h"
|
||||
#include "utils.h"
|
||||
#include "../widgets/tipswidget.h"
|
||||
#include "dbusutil.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QProcess>
|
||||
@ -100,17 +101,11 @@ void LauncherItem::mouseReleaseEvent(QMouseEvent *e)
|
||||
if (e->button() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
#ifdef USE_AM
|
||||
DDBusSender dbusSender = DDBusSender()
|
||||
.service("org.deepin.dde.Launcher1")
|
||||
.path("/org/deepin/dde/Launcher1")
|
||||
.interface("org.deepin.dde.Launcher1");
|
||||
#else
|
||||
DDBusSender dbusSender = DDBusSender()
|
||||
.service("com.deepin.dde.Launcher")
|
||||
.path("/com/deepin/dde/Launcher")
|
||||
.interface("com.deepin.dde.Launcher");
|
||||
#endif
|
||||
.service(launcherService)
|
||||
.path(launcherPath)
|
||||
.interface(launcherInterface);
|
||||
|
||||
QDBusPendingReply<bool> visibleReply = dbusSender.property("Visible").get();
|
||||
if (!visibleReply.value())
|
||||
dbusSender.method("Show").call();
|
||||
|
@ -32,9 +32,47 @@
|
||||
#ifdef USE_AM
|
||||
using DockInter = org::deepin::dde::daemon::DdeDock;
|
||||
using DockEntryInter = org::deepin::dde::daemon::dock::DockEntry;
|
||||
|
||||
const QString xEventMonitorService = "org.deepin.api.XEventMonitor1";
|
||||
const QString xEventMonitorPath = "/org/deepin/api/XEventMonitor1";
|
||||
|
||||
const QString launcherService = "org.deepin.dde.Launcher1";
|
||||
const QString launcherPath = "/org/deepin/dde/Launcher1";
|
||||
const QString launcherInterface = "org.deepin.dde.Launcher1";
|
||||
|
||||
const QString controllCenterService = "org.deepin.dde.ControlCenter1";
|
||||
const QString controllCenterPath = "/org/deepin/dde/ControlCenter1";
|
||||
const QString controllCenterInterface = "org.deepin.dde.ControlCenter1";
|
||||
|
||||
const QString notificationService = "org.deepin.dde.Notification1";
|
||||
const QString notificationPath = "/org/deepin/dde/Notification1";
|
||||
const QString notificationInterface = "org.deepin.dde.Notification1";
|
||||
|
||||
const QString sessionManagerService = "org.deepin.SessionManager1";
|
||||
const QString sessionManagerPath = "/org/deepin/SessionManager1";
|
||||
const QString sessionManagerInterface = "org.deepin.SessionManager1";
|
||||
#else
|
||||
using DockInter = com::deepin::dde::daemon::Dock;
|
||||
using DockEntryInter = com::deepin::dde::daemon::dock::Entry;
|
||||
|
||||
const QString xEventMonitorService = "com.deepin.api.XEventMonitor";
|
||||
const QString xEventMonitorPath = "/com/deepin/api/XEventMonitor";
|
||||
|
||||
const QString launcherService = "com.deepin.dde.Launcher";
|
||||
const QString launcherPath = "/com/deepin/dde/Launcher";
|
||||
const QString launcherInterface = "com.deepin.dde.Launcher";
|
||||
|
||||
const QString controllCenterService = "com.deepin.dde.ControlCenter";
|
||||
const QString controllCenterPath = "/com/deepin/dde/ControlCenter";
|
||||
const QString controllCenterInterface = "com.deepin.dde.ControlCenter";
|
||||
|
||||
const QString notificationService = "com.deepin.dde.Notification";
|
||||
const QString notificationPath = "/com/deepin/dde/Notification";
|
||||
const QString notificationInterface = "com.deepin.dde.Notification";
|
||||
|
||||
const QString sessionManagerService = "com.deepin.SessionManager";
|
||||
const QString sessionManagerPath = "/com/deepin/SessionManager";
|
||||
const QString sessionManagerInterface = "com.deepin.SessionManager";
|
||||
#endif
|
||||
|
||||
inline const QString dockServiceName()
|
||||
|
@ -156,16 +156,16 @@ void MenuWorker::createMenu(QMenu *settingsMenu)
|
||||
void MenuWorker::onDockSettingsTriggered()
|
||||
{
|
||||
#ifdef USE_AM
|
||||
DDBusSender().service("org.deepin.dde.ControlCenter1")
|
||||
.path("/org/deepin/dde/ControlCenter1")
|
||||
.interface("org.deepin.dde.ControlCenter1")
|
||||
DDBusSender().service(controllCenterService)
|
||||
.path(controllCenterPath)
|
||||
.interface(controllCenterInterface)
|
||||
.method("ShowPage")
|
||||
.arg(QString("personalization/desktop/dock"))
|
||||
.call();
|
||||
#else
|
||||
DDBusSender().service("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
DDBusSender().service(controllCenterService)
|
||||
.path("controllCenterPath")
|
||||
.interface(controllCenterInterface)
|
||||
.method("ShowPage")
|
||||
.arg(QString("personalization/dock"))
|
||||
.call();
|
||||
|
@ -55,11 +55,11 @@ const QString OnlyShowPrimary = "onlyShowPrimary";
|
||||
|
||||
MultiScreenWorker::MultiScreenWorker(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_eventInter(new XEventMonitor("com.deepin.api.XEventMonitor", "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus(), this))
|
||||
, m_extralEventInter(new XEventMonitor("com.deepin.api.XEventMonitor", "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus(), this))
|
||||
, m_touchEventInter(new XEventMonitor("com.deepin.api.XEventMonitor", "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus(), this))
|
||||
, m_eventInter(new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus(), this))
|
||||
, m_extralEventInter(new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus(), this))
|
||||
, m_touchEventInter(new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus(), this))
|
||||
, m_dockInter(new DockInter(dockServiceName(), dockServicePath(), QDBusConnection::sessionBus(), this))
|
||||
, m_launcherInter(new DBusLuncher("com.deepin.dde.Launcher", "/com/deepin/dde/Launcher", QDBusConnection::sessionBus(), this))
|
||||
, m_launcherInter(new DBusLuncher(launcherService, launcherPath, QDBusConnection::sessionBus(), this))
|
||||
, m_monitorUpdateTimer(new QTimer(this))
|
||||
, m_delayWakeTimer(new QTimer(this))
|
||||
, m_position(Dock::Position::Bottom)
|
||||
@ -856,20 +856,19 @@ void MultiScreenWorker::checkXEventMonitorService()
|
||||
connect(touchEventInter, &XEventMonitor::ButtonRelease, this, &MultiScreenWorker::onTouchRelease);
|
||||
};
|
||||
|
||||
const QString serverName = "com.deepin.api.XEventMonitor";
|
||||
QDBusConnectionInterface *ifc = QDBusConnection::sessionBus().interface();
|
||||
|
||||
if (!ifc->isServiceRegistered(serverName)) {
|
||||
if (!ifc->isServiceRegistered(xEventMonitorService)) {
|
||||
connect(ifc, &QDBusConnectionInterface::serviceOwnerChanged, this, [ = ](const QString & name, const QString & oldOwner, const QString & newOwner) {
|
||||
Q_UNUSED(oldOwner)
|
||||
if (name == serverName && !newOwner.isEmpty()) {
|
||||
if (name == xEventMonitorService && !newOwner.isEmpty()) {
|
||||
FREE_POINT(m_eventInter);
|
||||
FREE_POINT(m_extralEventInter);
|
||||
FREE_POINT(m_touchEventInter);
|
||||
|
||||
m_eventInter = new XEventMonitor(serverName, "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus());
|
||||
m_extralEventInter = new XEventMonitor(serverName, "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus());
|
||||
m_touchEventInter = new XEventMonitor(serverName, "/com/deepin/api/XEventMonitor", QDBusConnection::sessionBus());
|
||||
m_eventInter = new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus());
|
||||
m_extralEventInter = new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus());
|
||||
m_touchEventInter = new XEventMonitor(xEventMonitorService, xEventMonitorPath, QDBusConnection::sessionBus());
|
||||
// connect
|
||||
connectionInit(m_eventInter, m_extralEventInter, m_touchEventInter);
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "tipswidget.h"
|
||||
#include "dockpopupwindow.h"
|
||||
#include "utils.h"
|
||||
#include "dbusutil.h"
|
||||
|
||||
#include <DFontSizeManager>
|
||||
#include <DDBusSender>
|
||||
@ -338,23 +339,13 @@ void DateTimeDisplayer::createMenuItem()
|
||||
if (!QFile::exists(ICBC_CONF_FILE)) {
|
||||
QAction *timeSettingAction = new QAction(tr("Time settings"), this);
|
||||
connect(timeSettingAction, &QAction::triggered, this, [ = ] {
|
||||
#ifdef USE_AM
|
||||
DDBusSender()
|
||||
.service("org.deepin.dde.ControlCenter1")
|
||||
.interface("org.deepin.dde.ControlCenter1")
|
||||
.path("/org/deepin/dde/ControlCenter1")
|
||||
.service(controllCenterService)
|
||||
.interface(controllCenterPath)
|
||||
.path(controllCenterInterface)
|
||||
.method(QString("ShowPage"))
|
||||
.arg(QString("datetime"))
|
||||
.call();
|
||||
#else
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.method(QString("ShowPage"))
|
||||
.arg(QString("datetime"))
|
||||
.call();
|
||||
#endif
|
||||
});
|
||||
|
||||
m_menu->addAction(timeSettingAction);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "settingdelegate.h"
|
||||
#include "imageutil.h"
|
||||
#include "slidercontainer.h"
|
||||
#include "dbusutil.h"
|
||||
|
||||
#include <DListView>
|
||||
#include <DPushButton>
|
||||
@ -194,17 +195,10 @@ void VolumeDevicesWidget::initConnection()
|
||||
m_deviceList->update();
|
||||
} else {
|
||||
// 打开控制中心的声音模块
|
||||
#ifdef USE_AM
|
||||
DDBusSender().service("org.deepin.dde.ControlCenter1")
|
||||
.path("/org/deepin/dde/ControlCenter1")
|
||||
.interface("org.deepin.dde.ControlCenter1")
|
||||
DDBusSender().service(controllCenterService)
|
||||
.path(controllCenterPath)
|
||||
.interface(controllCenterInterface)
|
||||
.method("ShowPage").arg(QString("sound")).call();
|
||||
#else
|
||||
DDBusSender().service("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.method("ShowPage").arg(QString("sound")).call();
|
||||
#endif
|
||||
hide();
|
||||
}
|
||||
});
|
||||
|
@ -117,9 +117,9 @@ void WindowManager::sendNotifications()
|
||||
// 在进入安全模式时,执行此DBUS耗时25S左右,导致任务栏显示阻塞,所以使用线程调用
|
||||
QtConcurrent::run(QThreadPool::globalInstance(), [ = ] {
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.Notification")
|
||||
.path("/com/deepin/dde/Notification")
|
||||
.interface("com.deepin.dde.Notification")
|
||||
.service(notificationService)
|
||||
.path(notificationPath)
|
||||
.interface(notificationInterface)
|
||||
.method(QString("Notify"))
|
||||
.arg(QString("dde-control-center")) // appname
|
||||
.arg(static_cast<uint>(0)) // id
|
||||
@ -394,9 +394,9 @@ void WindowManager::RegisterDdeSession()
|
||||
|
||||
if (!cookie.isEmpty()) {
|
||||
QDBusPendingReply<bool> r = DDBusSender()
|
||||
.interface("com.deepin.SessionManager")
|
||||
.path("/com/deepin/SessionManager")
|
||||
.service("com.deepin.SessionManager")
|
||||
.interface(sessionManagerService)
|
||||
.path(sessionManagerPath)
|
||||
.service(sessionManagerInterface)
|
||||
.method("Register")
|
||||
.arg(QString(cookie))
|
||||
.call();
|
||||
|
@ -38,14 +38,14 @@
|
||||
using DBusDock = org::deepin::dde::daemon::DdeDock;
|
||||
using DockEntryInter = org::deepin::dde::daemon::dock::DockEntry;
|
||||
|
||||
static const QString serviceName = QString("com.deepin.dde.daemon.Dock");
|
||||
static const QString servicePath = QString("/com/deepin/dde/daemon/Dock");
|
||||
static const QString serviceName = QString("org.deepin.dde.daemon.Dock1");
|
||||
static const QString servicePath = QString("/org/deepin/dde/daemon/Dock1");
|
||||
#else
|
||||
using DBusDock = com::deepin::dde::daemon::Dock;
|
||||
using DockEntryInter = com::deepin::dde::daemon::dock::Entry;
|
||||
|
||||
static const QString serviceName = QString("org.deepin.dde.daemon.Dock1");
|
||||
static const QString servicePath = QString("/org/deepin/dde/daemon/Dock1");
|
||||
static const QString serviceName = QString("com.deepin.dde.daemon.Dock");
|
||||
static const QString servicePath = QString("/com/deepin/dde/daemon/Dock");
|
||||
#endif
|
||||
|
||||
using namespace Dock;
|
||||
|
Loading…
x
Reference in New Issue
Block a user