1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-02 08:33:20 +00:00

Fixed bug, where user-sessions.changed, which could be emitted multiple times, caused duplicate privacy bars to be drawn

This commit is contained in:
Bryan Roe
2020-05-30 00:30:54 -07:00
parent eba4e2c60b
commit 51e6062966
2 changed files with 12 additions and 9 deletions

View File

@@ -201,10 +201,7 @@ function x_notifybar_check(title)
var uid = require('user-sessions').consoleUid();
if (uid >= that.min)
{
that._close2 = function ()
{
this.child.kill();
};
require('user-sessions').removeListener('changed', _changed);
var xinfo = require('monitor-info').getXInfo(uid);
that.child = require('child_process').execFile(process.execPath, [process.execPath.split('/').pop(), '-b64exec', script], { uid: uid, env: xinfo.exportEnv() });
that.child.descriptorMetadata = 'notifybar-desktop';
@@ -212,6 +209,12 @@ function x_notifybar_check(title)
that.child.stdout.on('data', function (c) { });
that.child.stderr.on('data', function (c) { });
that.child.on('exit', function (code) { this.parent.emit('close', code); });
that._close2 = function _close2()
{
_close2.child.kill();
};
that._close2.child = that.child;
}
};
ret._changed.self = ret;