Skip to content

Commit

Permalink
Switch back to greeter when logind emits SecureAttentionKey
Browse files Browse the repository at this point in the history
  • Loading branch information
n3rdopolis committed Apr 30, 2024
1 parent 8c22a51 commit 3fcfa92
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/login1.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <gio/gio.h>

#include "login1.h"
#include "seat.h"

#define LOGIN1_SERVICE_NAME "org.freedesktop.login1"
#define LOGIN1_OBJECT_NAME "/org/freedesktop/login1"
Expand Down Expand Up @@ -248,6 +249,20 @@ signal_cb (GDBusConnection *connection,
g_signal_emit (service, service_signals[SEAT_REMOVED], 0, seat);
}
}
else if (strcmp (signal_name, "SecureAttentionKey") == 0)
{
Login1SeatPrivate *s_priv;
const gchar *id, *path;
g_variant_get (parameters, "(&s&o)", &id, &path);

g_autoptr(Login1Seat) seat = login1_service_get_seat (service, id);
s_priv = login1_seat_get_instance_private (seat);
if (seat)
{
seat_switch_to_greeter (s_priv->id);
}

}
}

gboolean
Expand Down

0 comments on commit 3fcfa92

Please sign in to comment.