aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-11-24 17:40:21 +0100
committerRobert Tari <robert@tari.in>2023-11-24 17:40:21 +0100
commit3f333ac16ef828522bb506f87f3d8a8b38b3ec67 (patch)
tree33aaef3016dfc5c377a0cd79917deac7cc2c118f /src
parentd604c30921766834dfd40622e66757f650c26842 (diff)
downloadarctica-greeter-3f333ac16ef828522bb506f87f3d8a8b38b3ec67.tar.gz
arctica-greeter-3f333ac16ef828522bb506f87f3d8a8b38b3ec67.tar.bz2
arctica-greeter-3f333ac16ef828522bb506f87f3d8a8b38b3ec67.zip
Send user change signal for manual user entries
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala5
-rw-r--r--src/user-list.vala21
2 files changed, 26 insertions, 0 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 7f1ddb2..1f9bbfa 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -133,6 +133,11 @@ public class ArcticaGreeter : Object
);
}
+ public DBusServer getDBusServer ()
+ {
+ return this.pServer;
+ }
+
private void onBusAcquired (DBusConnection pConnection)
{
try
diff --git a/src/user-list.vala b/src/user-list.vala
index 2c2fe3b..dee3850 100644
--- a/src/user-list.vala
+++ b/src/user-list.vala
@@ -39,6 +39,7 @@ int remote_server_field_sort_function (RemoteServerField? item1, RemoteServerFie
public class UserList : GreeterList
{
private bool _offer_guest = false;
+ private string sLastAddedUser = null;
public bool offer_guest
{
get { return _offer_guest; }
@@ -936,6 +937,11 @@ public class UserList : GreeterList
e.set_is_active (is_active);
debug ("Adding user to list. User: %s, background: %s, is_active: %s, has_messages: %s, session: %s", e.label, e.background, is_active.to_string(), has_messages.to_string(), session);
+ if (have_entries () && always_show_manual)
+ {
+ this.sLastAddedUser = label;
+ }
+
/* Remove manual option when have users */
if (have_entries () && !always_show_manual)
remove_entry ("*other");
@@ -1207,7 +1213,22 @@ public class UserList : GreeterList
}
}
else
+ {
base.show_prompt_cb (text, type);
+
+ if (type == LightDM.PromptType.SECRET && this.sLastAddedUser != null)
+ {
+ try
+ {
+ DBusServer pServer = this.greeter.getDBusServer ();
+ pServer.sendUserChange (this.sLastAddedUser);
+ }
+ catch (Error pError)
+ {
+ error ("Panic: %s", pError.message);
+ }
+ }
+ }
}
/* A lot of test code below here */