[gdm: 2/3] session: Emit session-opened-failed on session failures




commit 2f9afacd494311b8b7393848fec59bc8df7520b7
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Jul 9 18:27:37 2021 +0200

    session: Emit session-opened-failed on session failures
    
    We used the same signal (session-start-failed) when we had both session
    starting and opening failures.
    
    This may lead to wrong behaviors, so let's introduce another signal to
    notify such state.

 daemon/gdm-session.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 2bc9d943e..f705f0e07 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -172,6 +172,7 @@ enum {
         AUTHENTICATION_FAILED,
         VERIFICATION_COMPLETE,
         SESSION_OPENED,
+        SESSION_OPENED_FAILED,
         SESSION_STARTED,
         SESSION_START_FAILED,
         SESSION_EXITED,
@@ -883,7 +884,7 @@ on_opened (GdmDBusWorker *worker,
                 report_and_stop_conversation (self, service_name, error);
 
                 g_debug ("GdmSession: Emitting 'session-start-failed' signal");
-                g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
+                g_signal_emit (self, signals[SESSION_OPENED_FAILED], 0, service_name, error->message);
         }
 }
 
@@ -3746,6 +3747,17 @@ gdm_session_class_init (GdmSessionClass *session_class)
                               2,
                               G_TYPE_STRING,
                               G_TYPE_STRING);
+        signals [SESSION_OPENED_FAILED] =
+                g_signal_new ("session-opened-failed",
+                              GDM_TYPE_SESSION,
+                              G_SIGNAL_RUN_FIRST,
+                              0,
+                              NULL,
+                              NULL,
+                              g_cclosure_marshal_generic,
+                              G_TYPE_NONE,
+                              2,
+                              G_TYPE_STRING, G_TYPE_STRING);
         signals [SESSION_STARTED] =
                 g_signal_new ("session-started",
                               GDM_TYPE_SESSION,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]