diff options
author | Robert Tari <robert@tari.in> | 2023-05-09 02:48:54 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-05-09 07:37:24 +0200 |
commit | 63e624352750cc97c7169655603f48247f9924bf (patch) | |
tree | 9003493881cc26381ffe7374b1513ce73bce06cb /src/arctica-greeter.vala | |
parent | c4e49bf6cdae91be02caf428ae476e66cfdbe63e (diff) | |
download | arctica-greeter-63e624352750cc97c7169655603f48247f9924bf.tar.gz arctica-greeter-63e624352750cc97c7169655603f48247f9924bf.tar.bz2 arctica-greeter-63e624352750cc97c7169655603f48247f9924bf.zip |
src/arctica-greeter.vala: Modify user change signalling
Relying on LightDM's signals is not enough - we do not get the guest user.
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r-- | src/arctica-greeter.vala | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 4a38248..00004dc 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -64,15 +64,6 @@ public class ArcticaGreeter : Object greeter.show_prompt.connect ((text, type) => { - try - { - this.pServer.sendUserChange (); - } - catch (Error pError) - { - error ("Panic: %s", pError.message); - } - show_prompt (text, type); }); @@ -149,7 +140,7 @@ public class ArcticaGreeter : Object { try { - this.pServer = new DBusServer (pConnection, this.greeter); + this.pServer = new DBusServer (pConnection, this); pConnection.register_object ("/org/ArcticaProject/ArcticaGreeter", this.pServer); } catch (IOError pError) @@ -211,6 +202,18 @@ public class ArcticaGreeter : Object public void set_state (string key, string value) { + if (key == "last-user") + { + try + { + this.pServer.sendUserChange (value); + } + catch (Error pError) + { + error ("Panic: %s", pError.message); + } + } + state.set_value ("greeter", key, value); var data = state.to_data (); try @@ -1302,19 +1305,17 @@ private interface SettingsDaemonDBusInterface : Object public class DBusServer : Object { private DBusConnection pConnection; - private LightDM.Greeter pGreeter; + private ArcticaGreeter pGreeter; - public DBusServer (DBusConnection pConnection, LightDM.Greeter pGreeter) + public DBusServer (DBusConnection pConnection, ArcticaGreeter pGreeter) { this.pConnection = pConnection; this.pGreeter = pGreeter; } - public void sendUserChange () throws GLib.DBusError, GLib.IOError + public void sendUserChange (string sUser) throws GLib.DBusError, GLib.IOError { - string sUser = this.pGreeter.get_authentication_user (); - - if (sUser == null) + if (sUser == "*guest") { sUser = "GUEST"; } @@ -1333,9 +1334,9 @@ public class DBusServer : Object public string GetUser () throws GLib.DBusError, GLib.IOError { - string sUser = this.pGreeter.get_authentication_user (); + string sUser = this.pGreeter.get_state ("last-user"); - if (sUser == null) + if (sUser == "*guest") { sUser = "GUEST"; } |