on xenial help sign in
Don't change/set alert-state, if the app is focused.
commitd087e854fb1a262f9426a1528cca89968d89c282 authorMirco Müller <mirco.mueller@ubuntu.com> dateWed 10 Jun 2015, 15:18 (11 years ago) parent9e6c268
4 files changed+9−6
plugins/Unity/Launcher/launchermodel.cpp+4−2 qml/Launcher/LauncherPanel.qml−1 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+4−2 tests/qmltests/Launcher/tst_Launcher.qml+1−1
plugins/Unity/Launcher/launchermodel.cpp+4−2
@@ -94,8 +94,10 @@ void LauncherModel::alert(const QString &appId, bool alerting) {
9494 if (index >= 0) {
9595 QModelIndex modelIndex = this->index(index);
9696 LauncherItem *item = m_list.at(index);
97− item->setAlerting(alerting);
98− Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);
97+ if (!item->focused()) {
98+ item->setAlerting(alerting);
99+ Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);
100+ }
99101 }
100102}
101103
qml/Launcher/LauncherPanel.qml−1
@@ -431,7 +431,6 @@ Rectangle {
431431 }
432432
433433 onPositionChanged: {
434− print("position:", mouseX, "/", mouseY)
435434 if (draggedIndex >= 0) {
436435 if (!selectedItem.dragging) {
437436 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+4−2
@@ -124,8 +124,10 @@ void MockLauncherModel::alert(const QString &appId, bool alerting) {
124124 if (index >= 0) {
125125 QModelIndex modelIndex = this->index(index);
126126 MockLauncherItem *item = m_list.at(index);
127− item->setAlerting(alerting);
128− Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);
127+ if (!item->focused()) {
128+ item->setAlerting(alerting);
129+ Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);
130+ }
129131 }
130132}
131133
tests/qmltests/Launcher/tst_Launcher.qml+1−1
@@ -139,7 +139,7 @@ Item {
139139 width: units.gu(4)
140140 height: units.gu(4)
141141 autoSize: true
142− text: "gallery-app"
142+ text: "dialer-app"
143143 maximumLineCount: 1
144144 }
145145