fix: 修复任务栏不响应信号的问题
后端服务的信号没有参数,而任务栏的服务的信号中是带参数的,因此将后端的接口中加上参数即可 Log: Task: https://pms.uniontech.com/task-view-133075.html Influence: 调整任务栏位置,查看任务栏位置是否变化 Change-Id: Ibe97dfdff487407d8e7680168bd5993aaeedeac2
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user