on xenial help sign in
Only take normal and dialog surface types into account for launcher items (LP: #1669047)

Approved by: Michael Zanetti, Unity8 CI Bot

commit66efbd09448ca2e717358e300d2489ad72c33738 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 28 Mar 2017, 21:45 (10 years ago) parentb377bdc86a7eb0
1 file changed+9−7
plugins/Unity/Launcher/launchermodel.cpp+9−7
plugins/Unity/Launcher/launchermodel.cpp+9−7
@@ -573,14 +573,16 @@ void LauncherModel::updateSurfaceListForApp(ApplicationInfoInterface* app)
573573 QList<QPair<QString, QString> > surfaces;
574574 for (int i = 0; i < app->surfaceList()->count(); ++i) {
575575 MirSurfaceInterface* iface = app->surfaceList()->get(i);
576− // Avoid duplicate connections, so let's just disconnect first to be sure
577− disconnect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
578− connect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
579− QString name = iface->name();
580− if (name.isEmpty()) {
581− name = app->name();
576+ if (iface->type() == Mir::NormalType || iface->type() == Mir::DialogType) {
577+ // Avoid duplicate connections, so let's just disconnect first to be sure
578+ disconnect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
579+ connect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
580+ QString name = iface->name();
581+ if (name.isEmpty()) {
582+ name = app->name();
583+ }
584+ surfaces.append({iface->persistentId(), name});
582585 }
583− surfaces.append({iface->persistentId(), name});
584586 }
585587 item->setSurfaces(surfaces);
586588 Q_EMIT dataChanged(index(idx), index(idx), {RoleSurfaceCount});