aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-09 07:37:51 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-09 07:37:51 +0200
commitf775bdc11ce77199ff01ef1b04dd082dc55b2f1d (patch)
tree9003493881cc26381ffe7374b1513ce73bce06cb
parentc4e49bf6cdae91be02caf428ae476e66cfdbe63e (diff)
parent63e624352750cc97c7169655603f48247f9924bf (diff)
downloadarctica-greeter-f775bdc11ce77199ff01ef1b04dd082dc55b2f1d.tar.gz
arctica-greeter-f775bdc11ce77199ff01ef1b04dd082dc55b2f1d.tar.bz2
arctica-greeter-f775bdc11ce77199ff01ef1b04dd082dc55b2f1d.zip
Merge branch 'tari01-pr/user-change-fix'
Attributes GH PR #50: https://github.com/ArcticaProject/arctica-greeter/pull/50
-rw-r--r--src/arctica-greeter.vala37
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";
}