Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ DockPanel::DockPanel(QObject * parent)
, m_theme(ColorTheme::Dark)
, m_hideState(Hide)
, m_compositorReady(false)
, m_launcherShown(false)
{
// connect(this, &DockPanel::compositorReadyChanged, this, &DockPanel::loadDockPlugins);
}
Expand Down Expand Up @@ -131,6 +132,9 @@ bool DockPanel::init()
Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect());
});

// TODO: get launchpad status from applet not dbus
QDBusConnection::sessionBus().connect("org.deepin.dde.Launcher1", "/org/deepin/dde/Launcher1", "org.deepin.dde.Launcher1", "VisibleChanged", this, SLOT(launcherVisibleChanged(bool)));

return true;
}

Expand Down Expand Up @@ -258,7 +262,7 @@ void DockPanel::setCompositorReady(bool ready)

HideState DockPanel::hideState()
{
if (hideMode() == KeepShowing)
if (hideMode() == KeepShowing || m_launcherShown)
return Show;
return m_hideState;
}
Expand Down Expand Up @@ -314,6 +318,16 @@ void DockPanel::loadDockPlugins()
}
}

void DockPanel::launcherVisibleChanged(bool visible)
{
if (visible == m_launcherShown) return;

m_launcherShown = visible;
if (hideMode() != KeepShowing) {
Q_EMIT hideStateChanged(hideState());
}
}

void DockPanel::setMouseGrabEnabled(QQuickItem *item, bool enabled)
{
if (!item) return;
Expand Down
2 changes: 2 additions & 0 deletions panels/dock/dockpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext
private Q_SLOTS:
void onWindowGeometryChanged();
void loadDockPlugins();
void launcherVisibleChanged(bool visible);

Q_SIGNALS:
void geometryChanged(QRect geometry);
Expand All @@ -99,6 +100,7 @@ private Q_SLOTS:
HideState m_hideState;
DockHelper* m_helper;
bool m_compositorReady;
bool m_launcherShown;
};

}