Skip to content

Commit b56f1a5

Browse files
committed
fix: init showingDesktop for smart Hide.
as title. Logs:
1 parent 6f3d4e9 commit b56f1a5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

panels/dock/x11dockhelper.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <QGuiApplication>
1717
#include <QPointer>
1818
#include <QDBusConnection>
19+
#include <QDBusInterface>
20+
#include <QDBusReply>
1921

2022
namespace dock {
2123
Q_LOGGING_CATEGORY(dockX11Log, "dde.shell.dock.x11")
@@ -628,7 +630,12 @@ void X11DockWakeUpArea::updateDockWakeArea(Position pos)
628630

629631
void X11DockHelper::setupKWinDBusConnection()
630632
{
631-
// 连接到 KWin 的 D-Bus 接口监听 showingDesktopChanged 信号
633+
QDBusInterface kwin("org.kde.KWin", "/KWin", "org.kde.KWin", QDBusConnection::sessionBus());
634+
if (kwin.isValid()) {
635+
QVariant property = kwin.property("showingDesktop");
636+
m_showingDesktop = property.toBool();
637+
}
638+
632639
QDBusConnection::sessionBus().connect(
633640
"org.kde.KWin",
634641
"/KWin",

0 commit comments

Comments
 (0)