From 6574b4f2705ae7e37e7e57d6b57190094c2467c7 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 2 Aug 2018 14:00:46 -0400 Subject: common: dedupe activate_session_id Right now there are three copies of activate_session_id. This commit consolidates the code to gdm-common.c --- common/gdm-common.c | 10 +++++----- common/gdm-common.h | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/gdm-common.c b/common/gdm-common.c index 613511c4..d807c019 100644 --- a/common/gdm-common.c +++ b/common/gdm-common.c @@ -352,10 +352,10 @@ create_transient_display (GDBusConnection *connection, return TRUE; } -static gboolean -activate_session_id (GDBusConnection *connection, - const char *seat_id, - const char *session_id) +gboolean +gdm_activate_session_by_id (GDBusConnection *connection, + const char *seat_id, + const char *session_id) { GError *local_error = NULL; GVariant *reply; @@ -529,7 +529,7 @@ goto_login_session (GDBusConnection *connection, res = gdm_get_login_window_session_id (seat_id, &session_id); if (res && session_id != NULL) { - res = activate_session_id (connection, seat_id, session_id); + res = gdm_activate_session_by_id (connection, seat_id, session_id); if (res) { ret = TRUE; diff --git a/common/gdm-common.h b/common/gdm-common.h index bd8ac705..07812b10 100644 --- a/common/gdm-common.h +++ b/common/gdm-common.h @@ -22,6 +22,8 @@ #define _GDM_COMMON_H #include +#include + #include #include @@ -71,6 +73,10 @@ char * gdm_shell_expand (const char *str, GdmExpandVarFunc expand_func, gpointer user_data); +gboolean gdm_activate_session_by_id (GDBusConnection *connection, + const char *seat_id, + const char *session_id); + G_END_DECLS #endif /* _GDM_COMMON_H */ -- cgit v1.2.1