Skip to content

Commit

Permalink
fix: don't emit FrontendWindowRectChanged signal
Browse files Browse the repository at this point in the history
don't emit FrontendWindowRectChanged signal

Issue: linuxdeepin/developer-center#8026
  • Loading branch information
wangfei committed Apr 22, 2024
1 parent 521674a commit 0f1847b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 7 additions & 6 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ bool DockPanel::init()
QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1");
QDBusConnection::sessionBus().registerObject("/org/deepin/dde/Dock1", "org.deepin.dde.Dock1", proxy);

DockDaemonAdaptor* dockDaemonAdaptor = new DockDaemonAdaptor(proxy);
dockDaemonAdaptor = new DockDaemonAdaptor(proxy);
QDBusConnection::sessionBus().registerService("org.deepin.dde.daemon.Dock1");
QDBusConnection::sessionBus().registerObject("/org/deepin/dde/daemon/Dock1", "org.deepin.dde.daemon.Dock1", proxy);
connect(SETTINGS, &DockSettings::positionChanged, this, [this, dockDaemonAdaptor](){
connect(SETTINGS, &DockSettings::positionChanged, this, [this](){
Q_EMIT positionChanged(position());
Q_EMIT dockDaemonAdaptor->PositionChanged(position());
Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect());
Expand All @@ -74,15 +74,15 @@ bool DockPanel::init()
connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, &DockPanel::itemAlignmentChanged);
connect(SETTINGS, &DockSettings::indicatorStyleChanged, this, &DockPanel::indicatorStyleChanged);

connect(SETTINGS, &DockSettings::dockSizeChanged, this, [this, dockDaemonAdaptor](){
connect(SETTINGS, &DockSettings::dockSizeChanged, this, [this](){
Q_EMIT dockDaemonAdaptor->WindowSizeEfficientChanged(dockSize());
Q_EMIT dockDaemonAdaptor->WindowSizeFashionChanged(dockSize());
Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect());
});
connect(SETTINGS, &DockSettings::hideModeChanged, this, [this, dockDaemonAdaptor](){
connect(SETTINGS, &DockSettings::hideModeChanged, this, [this](){
Q_EMIT dockDaemonAdaptor->HideModeChanged(hideMode());
});
connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, [this, dockDaemonAdaptor](){
connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, [this](){
Q_EMIT dockDaemonAdaptor->DisplayModeChanged(itemAlignment());
});

Expand Down Expand Up @@ -125,7 +125,7 @@ bool DockPanel::init()
}
});

QMetaObject::invokeMethod(this, [this, dockDaemonAdaptor](){
QMetaObject::invokeMethod(this, [this](){
Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect());
});

Expand Down Expand Up @@ -235,6 +235,7 @@ void DockPanel::setIndicatorStyle(const IndicatorStyle& style)

void DockPanel::onWindowGeometryChanged()
{
Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect());
Q_EMIT frontendWindowRectChanged(frontendWindowRect());
Q_EMIT geometryChanged(geometry());
}
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/dockpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

#include <QDBusContext>

class DockDaemonAdaptor;
namespace dock {
class DockHelper;

const QStringList pluginDirs = {
"/usr/lib/dde-dock/tmp/plugins/",
"/usr/lib/dde-dock/tmp/plugins/quick-trays/",
Expand Down Expand Up @@ -98,6 +100,7 @@ private Q_SLOTS:
HideState m_hideState;
DockHelper* m_helper;
bool m_compositorReady;
DockDaemonAdaptor* dockDaemonAdaptor;
};

}

0 comments on commit 0f1847b

Please sign in to comment.