Codebase list gnome-shell-extension-appindicator / d7fa506
FIX#107: Indicator stops working after screen lock Diego Rivera authored 5 years ago Marco Trevisan committed 4 years ago
2 changed file(s) with 12 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
4646 // monitor the bus manually to find out when the name vanished so we can reclaim it again.
4747 function maybe_enable_after_name_available() {
4848 // by the time we get called whe might not be enabled
49 if (isEnabled && !watchDog.isPresent && statusNotifierWatcher === null)
50 statusNotifierWatcher = new StatusNotifierWatcher.StatusNotifierWatcher();
49 if (isEnabled && (!watchDog.nameAcquired || !watchDog.isPresent) && statusNotifierWatcher === null)
50 statusNotifierWatcher = new StatusNotifierWatcher.StatusNotifierWatcher(watchDog);
5151 }
5252
5353 function enable() {
7474
7575 // will be set in the handlers which are guaranteed to be called at least once
7676 this.isPresent = false;
77 // Assume the name was acquired...we'll be told otherwise if necessary
78 this.nameAcquired = true;
7779
7880 this._watcher_id = Gio.DBus.session.watch_name("org.kde.StatusNotifierWatcher", 0,
7981 this._appeared_handler.bind(this), this._vanished_handler.bind(this));
82 }
83
84 setNameAcquired(acquired) {
85 this.nameAcquired = acquired;
8086 }
8187
8288 destroy() {
4343 */
4444 var StatusNotifierWatcher = class AppIndicators_StatusNotifierWatcher {
4545
46 constructor() {
46 constructor(watchDog) {
47 this.watchDog = watchDog;
4748 this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(Interfaces.StatusNotifierWatcher, this);
4849 this._dbusImpl.export(Gio.DBus.session, WATCHER_OBJECT);
4950 this._cancellable = new Gio.Cancellable;
6061
6162 _acquiredName() {
6263 this._everAcquiredName = true;
64 if (this.watchDog !== null) this.watchDog.setNameAcquired(true);
6365 }
6466
6567 _lostName() {
6769 Util.Logger.debug('Lost name' + WATCHER_BUS_NAME);
6870 else
6971 Util.Logger.warn('Failed to acquire ' + WATCHER_BUS_NAME);
72 if (this.watchDog !== null) this.watchDog.setNameAcquired(false);
7073 }
7174
7275