mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
loginManager: Allow access to the D-Bus user proxy
It’s needed in an upcoming commit, to watch the user’s state (active/online/offline/lingering/closing). Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
f9274bda97
commit
54b9972e53
1 changed files with 10 additions and 0 deletions
|
|
@ -106,6 +106,10 @@ class LoginManagerSystemd extends Signals.EventEmitter {
|
|||
this._sessionRemoved.bind(this));
|
||||
}
|
||||
|
||||
getCurrentUserProxy() {
|
||||
return this._userProxy;
|
||||
}
|
||||
|
||||
async getCurrentSessionProxy() {
|
||||
if (this._currentSession)
|
||||
return this._currentSession;
|
||||
|
|
@ -220,6 +224,12 @@ class LoginManagerSystemd extends Signals.EventEmitter {
|
|||
}
|
||||
|
||||
class LoginManagerDummy extends Signals.EventEmitter {
|
||||
getCurrentUserProxy() {
|
||||
// we could return a DummyUser object that fakes whatever callers
|
||||
// expect, but just never settling the promise should be safer
|
||||
return new Promise(() => {});
|
||||
}
|
||||
|
||||
getCurrentSessionProxy() {
|
||||
// we could return a DummySession object that fakes whatever callers
|
||||
// expect (at the time of writing: connect() and connectSignal()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue