Skip to content

Commit 3fcfa92

Browse files
committed
Switch back to greeter when logind emits SecureAttentionKey
1 parent 8c22a51 commit 3fcfa92

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/login1.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <gio/gio.h>
1515

1616
#include "login1.h"
17+
#include "seat.h"
1718

1819
#define LOGIN1_SERVICE_NAME "org.freedesktop.login1"
1920
#define LOGIN1_OBJECT_NAME "/org/freedesktop/login1"
@@ -248,6 +249,20 @@ signal_cb (GDBusConnection *connection,
248249
g_signal_emit (service, service_signals[SEAT_REMOVED], 0, seat);
249250
}
250251
}
252+
else if (strcmp (signal_name, "SecureAttentionKey") == 0)
253+
{
254+
Login1SeatPrivate *s_priv;
255+
const gchar *id, *path;
256+
g_variant_get (parameters, "(&s&o)", &id, &path);
257+
258+
g_autoptr(Login1Seat) seat = login1_service_get_seat (service, id);
259+
s_priv = login1_seat_get_instance_private (seat);
260+
if (seat)
261+
{
262+
seat_switch_to_greeter (s_priv->id);
263+
}
264+
265+
}
251266
}
252267

253268
gboolean

0 commit comments

Comments
 (0)