fix: 修复任务栏不响应信号的问题
后端服务的信号没有参数,而任务栏的服务的信号中是带参数的,因此将后端的接口中加上参数即可 Log: Task: https://pms.uniontech.com/task-view-133075.html Influence: 调整任务栏位置,查看任务栏位置是否变化 Change-Id: Ibe97dfdff487407d8e7680168bd5993aaeedeac2
This commit is contained in:
parent
fa3a508644
commit
2675e262e7
@ -31,7 +31,7 @@ PlasmaWindow::PlasmaWindow(const QString &service, const QString &path, const QD
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __WindowPrivate)
|
||||
{
|
||||
if (QMetaType::type("Rect") == QMetaType::UnknownType)
|
||||
if (QMetaType::type("DockRect") == QMetaType::UnknownType)
|
||||
registerRectMetaType();
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include "types/rect.h"
|
||||
#include "types/dockrect.h"
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.daemon.KWayland.PlasmaWindow
|
||||
@ -50,7 +50,7 @@ public Q_SLOTS: // METHODS
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<Rect> Geometry()
|
||||
inline QDBusPendingReply<DockRect> Geometry()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Geometry"), argumentList);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "rect.h"
|
||||
#include "dockrect.h"
|
||||
#include <QDebug>
|
||||
|
||||
Rect::Rect()
|
||||
DockRect::DockRect()
|
||||
: X(0)
|
||||
, Y(0)
|
||||
, Width(0)
|
||||
@ -10,7 +10,7 @@ Rect::Rect()
|
||||
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const Rect &rect)
|
||||
QDebug operator<<(QDebug debug, const DockRect &rect)
|
||||
{
|
||||
debug << QString("Rect(%1, %2, %3, %4)").arg(rect.X)
|
||||
.arg(rect.Y)
|
||||
@ -20,12 +20,12 @@ QDebug operator<<(QDebug debug, const Rect &rect)
|
||||
return debug;
|
||||
}
|
||||
|
||||
Rect::operator QRect() const
|
||||
DockRect::operator QRect() const
|
||||
{
|
||||
return QRect(X, Y, Width, Height);
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const Rect &rect)
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg << rect.X << rect.Y << rect.Width << rect.Height;
|
||||
@ -34,7 +34,7 @@ QDBusArgument &operator<<(QDBusArgument &arg, const Rect &rect)
|
||||
return arg;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, Rect &rect)
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg >> rect.X >> rect.Y >> rect.Width >> rect.Height;
|
||||
@ -45,6 +45,6 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, Rect &rect)
|
||||
|
||||
void registerRectMetaType()
|
||||
{
|
||||
qRegisterMetaType<Rect>("Rect");
|
||||
qDBusRegisterMetaType<Rect>();
|
||||
qRegisterMetaType<DockRect>("DockRect");
|
||||
qDBusRegisterMetaType<DockRect>();
|
||||
}
|
@ -4,20 +4,20 @@
|
||||
#include <QRect>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
struct Rect
|
||||
struct DockRect
|
||||
{
|
||||
public:
|
||||
Rect();
|
||||
DockRect();
|
||||
operator QRect() const;
|
||||
|
||||
friend QDebug operator<<(QDebug debug, const Rect &rect);
|
||||
friend const QDBusArgument &operator>>(const QDBusArgument &arg, Rect &rect);
|
||||
friend QDBusArgument &operator<<(QDBusArgument &arg, const Rect &rect);
|
||||
friend QDebug operator<<(QDebug debug, const DockRect &rect);
|
||||
friend const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect);
|
||||
friend QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect);
|
||||
|
||||
qint32 X, Y, Width, Height;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Rect)
|
||||
Q_DECLARE_METATYPE(DockRect)
|
||||
|
||||
void registerRectMetaType();
|
||||
|
@ -53,7 +53,7 @@ void DBusAdaptorDock::setDisplayMode(int value)
|
||||
{
|
||||
if (displayMode() != value) {
|
||||
parent()->setDisplayMode(value);
|
||||
Q_EMIT DisplayModeChanged();
|
||||
Q_EMIT DisplayModeChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,8 +78,8 @@ int DBusAdaptorDock::hideMode() const
|
||||
void DBusAdaptorDock::setHideMode(int value)
|
||||
{
|
||||
if (hideMode() != value) {
|
||||
parent()->setHideMode(HideMode(value));
|
||||
Q_EMIT HideModeChanged();
|
||||
parent()->setHideMode(static_cast<HideMode>(value));
|
||||
Q_EMIT HideModeChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ void DBusAdaptorDock::setHideTimeout(uint value)
|
||||
{
|
||||
if (hideTimeout() != value) {
|
||||
parent()->setHideTimeout(value);
|
||||
Q_EMIT HideTimeoutChanged();
|
||||
Q_EMIT HideTimeoutChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ void DBusAdaptorDock::setWindowSizeEfficient(uint value)
|
||||
{
|
||||
if (windowSizeEfficient() != value) {
|
||||
parent()->setWindowSizeEfficient(value);
|
||||
Q_EMIT WindowSizeEfficientChanged();
|
||||
Q_EMIT WindowSizeEfficientChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ void DBusAdaptorDock::setWindowSizeFashion(uint value)
|
||||
{
|
||||
if (windowSizeFashion() != value) {
|
||||
parent()->setWindowSizeFashion(value);
|
||||
Q_EMIT WindowSizeFashionChanged();
|
||||
Q_EMIT WindowSizeFashionChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ void DBusAdaptorDock::setIconSize(uint value)
|
||||
{
|
||||
if (iconSize() != value) {
|
||||
parent()->setIconSize(value);
|
||||
Q_EMIT IconSizeChanged();
|
||||
Q_EMIT IconSizeChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ void DBusAdaptorDock::setPosition(int value)
|
||||
{
|
||||
if (position() != value) {
|
||||
parent()->setPosition(value);
|
||||
Q_EMIT PositionChanged();
|
||||
Q_EMIT PositionChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ void DBusAdaptorDock::setShowTimeout(uint value)
|
||||
{
|
||||
if (showTimeout() != value) {
|
||||
parent()->setShowTimeout(value);
|
||||
Q_EMIT ShowTimeoutChanged();
|
||||
Q_EMIT ShowTimeoutChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QDBusObjectPath>
|
||||
#include <QRect>
|
||||
|
||||
/*
|
||||
@ -196,19 +197,19 @@ Q_SIGNALS: // SIGNALS
|
||||
void EntryAdded(const QDBusObjectPath &path, int index);
|
||||
void EntryRemoved(const QString &entryId);
|
||||
|
||||
void DisplayModeChanged();
|
||||
void DockedAppsChanged();
|
||||
void OpacityChanged();
|
||||
void EntriesChanged();
|
||||
void HideModeChanged();
|
||||
void WindowSizeEfficientChanged();
|
||||
void WindowSizeFashionChanged();
|
||||
void HideStateChanged();
|
||||
void FrontendWindowRectChanged();
|
||||
void HideTimeoutChanged();
|
||||
void IconSizeChanged();
|
||||
void PositionChanged();
|
||||
void ShowTimeoutChanged();
|
||||
void DisplayModeChanged(int value) const;
|
||||
void DockedAppsChanged(const QStringList &value) const;
|
||||
void EntriesChanged(const QList<QDBusObjectPath> &value) const;
|
||||
void FrontendWindowRectChanged() const;
|
||||
void HideModeChanged(int value) const;
|
||||
void HideStateChanged(int value) const;
|
||||
void HideTimeoutChanged(uint value) const;
|
||||
void IconSizeChanged(uint value) const;
|
||||
void OpacityChanged(double value) const;
|
||||
void PositionChanged(int value) const;
|
||||
void ShowTimeoutChanged(uint value) const;
|
||||
void WindowSizeEfficientChanged(uint value) const;
|
||||
void WindowSizeFashionChanged(uint value) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -792,7 +792,7 @@ bool Dock::isWindowDockOverlapK(WindowInfoBase *info)
|
||||
return false;
|
||||
}
|
||||
|
||||
Rect rect = infoK->getGeometry();
|
||||
DockRect rect = infoK->getGeometry();
|
||||
bool isActiveWin = infoK->getPlasmaWindow()->IsActive();
|
||||
QString appId = infoK->getAppId();
|
||||
if (!isActiveWin) {
|
||||
@ -815,7 +815,7 @@ bool Dock::isWindowDockOverlapK(WindowInfoBase *info)
|
||||
* @param dockRect 任务栏窗口
|
||||
* @return
|
||||
*/
|
||||
bool Dock::hasInterSectionK(const Rect &windowRect, QRect dockRect)
|
||||
bool Dock::hasInterSectionK(const DockRect &windowRect, QRect dockRect)
|
||||
{
|
||||
int position = getPosition();
|
||||
int ltX = MAX(windowRect.X, dockRect.x());
|
||||
@ -825,7 +825,7 @@ bool Dock::hasInterSectionK(const Rect &windowRect, QRect dockRect)
|
||||
|
||||
if (position == int(PositionMode::Left) || position == int(PositionMode::Right)) {
|
||||
return ltX <= rbX && ltY < rbY;
|
||||
} else if (position == int(PositionMode::TOP) || position == int(PositionMode::Bottom)) {
|
||||
} else if (position == int(PositionMode::Top) || position == int(PositionMode::Bottom)) {
|
||||
return ltX < rbX && ltY <= rbY;
|
||||
} else {
|
||||
return ltX < rbX && ltY < rbY;
|
||||
@ -979,7 +979,7 @@ void Dock::setPropHideState(HideState state)
|
||||
|
||||
if (state != hideState) {
|
||||
hideState = state;
|
||||
Q_EMIT hideStateChanged();
|
||||
Q_EMIT hideStateChanged(static_cast<int>(hideState));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "docksettings.h"
|
||||
#include "entries.h"
|
||||
#include "dbusplasmawindow.h"
|
||||
#include "dockrect.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
@ -149,7 +150,7 @@ Q_SIGNALS:
|
||||
void serviceRestarted();
|
||||
void entryAdded(QString entryObjPath, int32_t index);
|
||||
void entryRemoved(QString id);
|
||||
void hideStateChanged();
|
||||
void hideStateChanged(int);
|
||||
void frontendWindowRectChanged();
|
||||
|
||||
private Q_SLOTS:
|
||||
@ -166,7 +167,7 @@ private:
|
||||
bool isWindowDockOverlapX(XWindow xid);
|
||||
bool hasInterSectionX(const Geometry &windowRect, QRect dockRect);
|
||||
bool isWindowDockOverlapK(WindowInfoBase *info);
|
||||
bool hasInterSectionK(const Rect &windowRect, QRect dockRect);
|
||||
bool hasInterSectionK(const DockRect &windowRect, QRect dockRect);
|
||||
Entry *getDockedEntryByDesktopFile(const QString &desktopFile);
|
||||
bool shouldHideOnSmartHideMode();
|
||||
QVector<XWindow> getActiveWinGroup(XWindow xid);
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
|
||||
// 显示位置
|
||||
enum class PositionMode {
|
||||
TOP, // 上
|
||||
Top, // 上
|
||||
Right, // 右
|
||||
Bottom, // 下
|
||||
Left, // 左
|
||||
@ -123,7 +123,7 @@ public:
|
||||
|
||||
QString toString() {
|
||||
switch (modeEnum) {
|
||||
case PositionMode::TOP:
|
||||
case PositionMode::Top:
|
||||
return "top";
|
||||
case PositionMode::Right:
|
||||
return "right";
|
||||
@ -136,7 +136,7 @@ public:
|
||||
|
||||
PositionMode toEnum() {
|
||||
if (modeStr == "top")
|
||||
return PositionMode::TOP;
|
||||
return PositionMode::Top;
|
||||
if (modeStr == "right")
|
||||
return PositionMode::Right;
|
||||
if (modeStr == "bottom")
|
||||
|
@ -132,7 +132,7 @@ PlasmaWindow *WindowInfoK::getPlasmaWindow()
|
||||
|
||||
bool WindowInfoK::updateGeometry()
|
||||
{
|
||||
Rect rect = plasmaWindow->Geometry();
|
||||
DockRect rect = plasmaWindow->Geometry();
|
||||
if (geometry == rect)
|
||||
return false;
|
||||
|
||||
@ -180,7 +180,7 @@ void WindowInfoK::updateProcessInfo()
|
||||
* @brief WindowInfoK::getGeometry 获取窗口大小
|
||||
* @return
|
||||
*/
|
||||
Rect WindowInfoK::getGeometry()
|
||||
DockRect WindowInfoK::getGeometry()
|
||||
{
|
||||
return geometry;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
void updateInternalId();
|
||||
void updateCloseable();
|
||||
void updateProcessInfo();
|
||||
Rect getGeometry();
|
||||
DockRect getGeometry();
|
||||
|
||||
private:
|
||||
bool updateCalled;
|
||||
@ -74,7 +74,7 @@ private:
|
||||
bool closeable;
|
||||
bool minimized;
|
||||
PlasmaWindow *plasmaWindow;
|
||||
Rect geometry;
|
||||
DockRect geometry;
|
||||
};
|
||||
|
||||
#endif // WINDOWINFOK_H
|
||||
|
@ -26,151 +26,10 @@ qt5_add_dbus_adaptor(ADAPTER_SOURCES
|
||||
|
||||
add_definitions(-DUSE_QT)
|
||||
|
||||
set(SRCS ${PROJECT_BINARY_DIR}/src/define.h)
|
||||
|
||||
set(SRCS
|
||||
./applicationhelper.h
|
||||
./main.cpp
|
||||
./impl/application_manager.h
|
||||
./impl/application_manager.cpp
|
||||
./impl/application.h
|
||||
./impl/application.cpp
|
||||
./impl/application_instance.h
|
||||
./impl/application_instance.cpp
|
||||
../modules/tools/desktop_deconstruction.hpp
|
||||
../modules/socket/server.h
|
||||
../modules/socket/server.cpp
|
||||
../modules/methods/basic.h
|
||||
../modules/methods/task.hpp
|
||||
../modules/methods/instance.hpp
|
||||
../modules/methods/quit.hpp
|
||||
../modules/methods/registe.hpp
|
||||
../lib/desktopinfo.h
|
||||
../lib/desktopinfo.cpp
|
||||
../lib/dlocale.h
|
||||
../lib/dlocale.cpp
|
||||
../lib/dstring.h
|
||||
../lib/dstring.cpp
|
||||
../lib/keyfile.h
|
||||
../lib/keyfile.cpp
|
||||
../lib/lang.h
|
||||
../lib/macro.h
|
||||
../lib/process.h
|
||||
../lib/process.cpp
|
||||
../lib/dfile.h
|
||||
../lib/dfile.cpp
|
||||
../lib/basedir.h
|
||||
../lib/basedir.cpp
|
||||
../lib/xcbutils.h
|
||||
../lib/xcbutils.cpp
|
||||
../lib/applaunchcontext.h
|
||||
../lib/applaunchcontext.cpp
|
||||
../lib/meminfo.h
|
||||
../lib/meminfo.cpp
|
||||
../lib/gsetting.h
|
||||
../lib/gsetting.cpp
|
||||
../utils/settings.h
|
||||
../utils/settings.cpp
|
||||
../utils/synmodulebase.h
|
||||
../utils/synmodule.h
|
||||
../utils/synconfig.h
|
||||
../utils/synconfig.cpp
|
||||
../modules/apps/alrecorder.h
|
||||
../modules/apps/alrecorder.cpp
|
||||
../modules/apps/appmanager.h
|
||||
../modules/apps/appmanager.cpp
|
||||
../modules/apps/dfwatcher.h
|
||||
../modules/apps/dfwatcher.cpp
|
||||
../modules/apps/dbusalrecorderadaptor.h
|
||||
../modules/apps/dbusalrecorderadaptor.cpp
|
||||
../modules/launcher/common.h
|
||||
../modules/launcher/launcher.h
|
||||
../modules/launcher/launcher.cpp
|
||||
../modules/launcher/launchermanager.h
|
||||
../modules/launcher/launchermanager.cpp
|
||||
../modules/launcher/category.h
|
||||
../modules/launcher/category.cpp
|
||||
../modules/launcher/launchersettings.h
|
||||
../modules/launcher/launchersettings.cpp
|
||||
../modules/launcher/dbusadaptorlauncher.h
|
||||
../modules/launcher/dbusadaptorlauncher.cpp
|
||||
../modules/dock/dock.h
|
||||
../modules/dock/dock.cpp
|
||||
../modules/dock/dockmanager.h
|
||||
../modules/dock/dockmanager.cpp
|
||||
../modules/dock/windowidentify.h
|
||||
../modules/dock/windowidentify.cpp
|
||||
../modules/dock/windowinfobase.h
|
||||
../modules/dock/windowinfox.h
|
||||
../modules/dock/windowinfox.cpp
|
||||
../modules/dock/windowinfok.h
|
||||
../modules/dock/windowinfok.cpp
|
||||
../modules/dock/dbushandler.h
|
||||
../modules/dock/dbushandler.cpp
|
||||
../modules/dock/docksettings.h
|
||||
../modules/dock/docksettings.cpp
|
||||
../modules/dock/common.h
|
||||
../modules/dock/appinfo.h
|
||||
../modules/dock/appinfo.cpp
|
||||
../modules/dock/entry.h
|
||||
../modules/dock/entry.cpp
|
||||
../modules/dock/entries.h
|
||||
../modules/dock/entries.cpp
|
||||
../modules/dock/appmenu.h
|
||||
../modules/dock/appmenu.cpp
|
||||
../modules/dock/processinfo.h
|
||||
../modules/dock/processinfo.cpp
|
||||
../modules/dock/windowpatterns.h
|
||||
../modules/dock/windowpatterns.cpp
|
||||
../modules/dock/waylandmanager.h
|
||||
../modules/dock/waylandmanager.cpp
|
||||
../modules/dock/x11manager.h
|
||||
../modules/dock/x11manager.cpp
|
||||
../modules/dock/dbusadaptordock.h
|
||||
../modules/dock/dbusadaptordock.cpp
|
||||
../modules/dock/dbusadaptorentry.h
|
||||
../modules/dock/dbusadaptorentry.cpp
|
||||
../modules/startmanager/common.h
|
||||
../modules/startmanager/startmanager.h
|
||||
../modules/startmanager/startmanager.cpp
|
||||
../modules/startmanager/startmanagersettings.h
|
||||
../modules/startmanager/startmanagersettings.cpp
|
||||
../modules/startmanager/startmanagerdbushandler.h
|
||||
../modules/startmanager/startmanagerdbushandler.cpp
|
||||
../frameworkdbus/types/launcheriteminfo.h
|
||||
../frameworkdbus/types/launcheriteminfo.cpp
|
||||
../frameworkdbus/types/launcheriteminfolist.h
|
||||
../frameworkdbus/types/launcheriteminfolist.cpp
|
||||
../frameworkdbus/types/rect.h
|
||||
../frameworkdbus/types/rect.cpp
|
||||
../frameworkdbus/types/unlaunchedappmap.h
|
||||
../frameworkdbus/types/unlaunchedappmap.cpp
|
||||
../frameworkdbus/dbuslauncherfront.h
|
||||
../frameworkdbus/dbuslauncherfront.cpp
|
||||
../frameworkdbus/dbuslauncher.h
|
||||
../frameworkdbus/dbuslauncher.cpp
|
||||
../frameworkdbus/dbuswm.h
|
||||
../frameworkdbus/dbuswm.cpp
|
||||
../frameworkdbus/dbuswmswitcher.h
|
||||
../frameworkdbus/dbuswmswitcher.cpp
|
||||
../frameworkdbus/dbuskwaylandwindowmanager.h
|
||||
../frameworkdbus/dbuskwaylandwindowmanager.cpp
|
||||
../frameworkdbus/dbusplasmawindow.h
|
||||
../frameworkdbus/dbusplasmawindow.cpp
|
||||
../frameworkdbus/dbuskwaylandoutput.h
|
||||
../frameworkdbus/dbuskwaylandoutput.cpp
|
||||
../frameworkdbus/dbusbamfapplication.h
|
||||
../frameworkdbus/dbusbamfapplication.cpp
|
||||
../frameworkdbus/dbusbamfmatcher.h
|
||||
../frameworkdbus/dbusbamfmatcher.cpp
|
||||
../frameworkdbus/qtdbusextended/dbusextended.h
|
||||
../frameworkdbus/qtdbusextended/dbusextendedabstractinterface.h
|
||||
../frameworkdbus/qtdbusextended/dbusextendedpendingcallwatcher_p.h
|
||||
../frameworkdbus/qtdbusextended/dbusextendedabstractinterface.cpp
|
||||
../frameworkdbus/qtdbusextended/dbusextendedpendingcallwatcher.cpp
|
||||
../frameworkdbus/qtdbusextended/DBusExtended
|
||||
../frameworkdbus/qtdbusextended/DBusExtendedAbstractInterface
|
||||
)
|
||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../frameworkdbus/*.h" "../frameworkdbus/*.cpp"
|
||||
"../lib/*.h" "../lib/*.cpp" "../lib/*.hpp"
|
||||
"../modules/*.h" "../modules/*.cpp" "../modules/*.hpp"
|
||||
"../utils.h" "../utils/*.cpp")
|
||||
|
||||
add_executable(deepin-application-manager
|
||||
${SRCS}
|
||||
|
Loading…
Reference in New Issue
Block a user