@@ -74,6 +74,8 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
7474 return item->icon();
7575 case RolePinned:
7676 return item->pinned();
77+ case RoleRunning:
78+ return item->running();
7779 case RoleCount:
7880 return item->count();
7981 case RoleCountVisible:
@@ -476,10 +478,13 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
476478 m_asAdapter->syncItems(m_list);
477479 Q_EMIT dataChanged(index(itemIndex), index(itemIndex), QVector<int>() << RoleRecent);
478480 }
481+ item->setRunning(true);
482+ Q_EMIT dataChanged(index(itemIndex), index(itemIndex), QVector<int>() << RoleRunning);
479483 // Shall we paint some running/recent app highlight? If yes, do it here.
480484 } else {
481485 LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString(), this);
482486 item->setRecent(true);
487+ item->setRunning(true);
483488 item->setFocused(app->focused());
484489
485490 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
@@ -501,11 +506,17 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
501506 }
502507 }
503508
504− if (appIndex > -1 && !m_list.at(appIndex)->pinned()) {
505− beginRemoveRows(QModelIndex(), appIndex, appIndex);
506− m_list.takeAt(appIndex)->deleteLater();
507− endRemoveRows();
508− m_asAdapter->syncItems(m_list);
509+ if (appIndex > -1) {
510+ LauncherItem *item = m_list.at(appIndex);
511+ item->setRunning(false);
512+ Q_EMIT dataChanged(index(appIndex), index(appIndex), QVector<int>() << RoleRunning);
513+
514+ if (!m_list.at(appIndex)->pinned()) {
515+ beginRemoveRows(QModelIndex(), appIndex, appIndex);
516+ m_list.takeAt(appIndex)->deleteLater();
517+ endRemoveRows();
518+ m_asAdapter->syncItems(m_list);
519+ }
509520 }
510521}
511522