@@ -47,6 +47,8 @@ void DashCommunicator::setCurrentScope(const QString &scopeId, bool animate, boo
4747 }
4848
4949 if (m_dashInterface && m_dashInterface->isValid()) {
50+ // Using an async call just in case the Dash would fail to wake up from suspend
51+ // We don't want to hang the whole shell waiting for reply.
5052 m_dashInterface->asyncCall("SetCurrentScope", scopeId, animate, isSwipe);
5153 }
5254}
@@ -60,6 +62,7 @@ void DashCommunicator::connectToDash()
6062
6163 if (m_applicationManager) {
6264 ApplicationInfoInterface *dash = m_applicationManager->findApplication("unity8-dash");
65+ // Don't try to connect to the Dash while its suspended, it would hang the shell waiting for a reply.
6366 if (dash && dash->state() == ApplicationInfoInterface::Running) {
6467 QDBusConnection connection = QDBusConnection::sessionBus();
6568 m_dashInterface = new QDBusInterface("com.canonical.UnityDash",
@@ -85,9 +88,10 @@ void DashCommunicator::setApplicationManager(unity::shell::application::Applicat
8588
8689 connect(m_applicationManager, &unity::shell::application::ApplicationManagerInterface::applicationAdded, this, &DashCommunicator::applicationAdded);
8790 connect(m_applicationManager, &unity::shell::application::ApplicationManagerInterface::applicationRemoved, this, &DashCommunicator::applicationRemoved);
88−
91+
92+ // If the Dash is around already, immediately try to connect
8993 if (m_applicationManager->findApplication("unity8-dash")) {
90− applicationAdded("unity8-dash");
94+ connectToDash();
9195 }
9296 }
9397}
@@ -99,7 +103,7 @@ void DashCommunicator::applicationAdded(const QString &appId)
99103 }
100104 ApplicationInfoInterface *app = m_applicationManager->findApplication(appId);
101105 if (!app) {
102− qWarning() << "DashCommunicator received an applicationAdded signal for dash, but there's no dash!";
106+ qWarning() << "DashCommunicator received an applicationAdded signal for the dash, but there's no dash around!";
103107 return;
104108 }
105109 connectToDash();
@@ -110,6 +114,8 @@ void DashCommunicator::applicationRemoved(const QString &appId)
110114 if (appId != "unity8-dash") {
111115 return;
112116 }
113− m_dashInterface->deleteLater();
114− m_dashInterface = nullptr;
117+ if (m_dashInterface) {
118+ m_dashInterface->deleteLater();
119+ m_dashInterface = nullptr;
120+ }
115121}