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