Comment 14 for bug 854261

Revision history for this message
LaƩrcio de Sousa (lbssousa) wrote :

Never mind! I've just found a VERY MUCH SIMPLER approach to solve this issue.

The key point is the global boolean variable "prompted". When lightdm-gtk-greeter calls lightdm_greeter_authenticate_autologin(), it waits for a signal and then calls function authentication_complete_cb(), which, in turn, starts user session. However, it only does it if "prompted" is set to TRUE, which is not the case for autologin.

So, all we have to do in my proposed autologin_cb() function is setting "prompted" to TRUE while calling lightdm_greeter_authenticate_autologin(). Here is my very smaller autologin_cb() implementation:

static void
autologin_cb (LightDMGreeter *greeter)
{
    prompted = TRUE;
    lightdm_greeter_authenticate_autologin (greeter);
}

I've tested it, and now it works in all possible scenarios.