Skip to content

Commit 136de6b

Browse files
committed
appIcons: Setup unity indicator properties on construction
These properties may have been set already by any application around (hey snapd!), so we need to initialize the values properly and not only rely on updates. So that when application is launched we pick those values
1 parent 6dff79f commit 136de6b

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

appIconIndicators.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,12 @@ class UnityIndicator extends IndicatorBase {
760760
'style-changed',
761761
() => this._updateIconStyle(),
762762
]);
763+
764+
this._updateNotificationsCount();
765+
this.setProgress(this._remoteEntry.progress_visible
766+
? this._remoteEntry.progress : -1);
767+
this.setUrgent(this._remoteEntry.urgent);
768+
this.setUpdating(this._remoteEntry.updating);
763769
}
764770

765771
destroy() {

appIcons.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const DockAbstractAppIcon = GObject.registerClass({
123123
this._signalsHandler = new Utils.GlobalSignalsHandler(this);
124124
this.iconAnimator = iconAnimator;
125125
this._indicator = new AppIconIndicators.AppIconIndicator(this);
126+
this._urgentWindows = new Set();
126127

127128
// Monitor windows-changes instead of app state.
128129
// Keep using the same Id and function callback (that is extended)
@@ -157,20 +158,23 @@ const DockAbstractAppIcon = GObject.registerClass({
157158
else
158159
this.remove_style_class_name('running');
159160
});
161+
this.notify('running');
160162

161163
this.connect('notify::focused', () => {
162164
if (this.focused)
163165
this.add_style_class_name('focused');
164166
else
165167
this.remove_style_class_name('focused');
166168
});
169+
this.notify('focused');
167170

168171
this.connect('notify::updating', () => {
169172
if (this.updating)
170173
this.add_style_class_name('updating');
171174
else
172175
this.remove_style_class_name('updating');
173176
});
177+
this.notify('updating');
174178

175179
const {notificationsMonitor} = Docking.DockManager.getDefault();
176180

@@ -195,8 +199,8 @@ const DockAbstractAppIcon = GObject.registerClass({
195199
this._updateUrgentWindows();
196200
}
197201
});
202+
this.notify('urgent');
198203

199-
this._urgentWindows = new Set();
200204
this._progressOverlayArea = null;
201205
this._progress = 0;
202206

0 commit comments

Comments
 (0)