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:
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 greeter_ authenticate_ autologin (greeter);
autologin_cb (LightDMGreeter *greeter)
{
prompted = TRUE;
lightdm_
}
I've tested it, and now it works in all possible scenarios.