Annoyingly, logonui can fail to start the user's session because the default session given by LightDM is invalid. I noticed this on Arch Linux, though not sure if it's specific to Arch's configs or whether it is a LightDM problem.
Essentially logonui is calling lightdm_start_session_sync() with NULL as the session to request LightDM start the default session. For me on my Arch Linux VM, this results in it trying to start session default which fails.
I had a look at lightdm-gtk-greeter's source (as per usual) as some forum posts about this problem suggested this greeter works and other ones don't.
Seems like what's needed is to call lightdm_greeter_get_default_session_hint() to retrieve what LightDM thinks the default session is, and then check if it exists in the sessions from lightdm_get_sessions() (check against lightdm_session_get_key() I think?)
In any case, should probably prioritise loading XFCE session, perhaps searching forxfce*in the sessions list. Also handle lack of session or failure to start session gracefully. At the moment it just stays on thewelcome` screen forever. Same goes for classic logon.
Annoyingly,
logonui
can fail to start the user's session because the default session given by LightDM is invalid. I noticed this on Arch Linux, though not sure if it's specific to Arch's configs or whether it is a LightDM problem.Essentially logonui is calling
lightdm_start_session_sync()
withNULL
as the session to request LightDM start the default session. For me on my Arch Linux VM, this results in it trying to start sessiondefault
which fails.I had a look at
lightdm-gtk-greeter
's source (as per usual) as some forum posts about this problem suggested this greeter works and other ones don't.Seems like what's needed is to call
lightdm_greeter_get_default_session_hint()
to retrieve what LightDM thinks the default session is, and then check if it exists in the sessions fromlightdm_get_sessions()
(check againstlightdm_session_get_key()
I think?)In any case, should probably prioritise loading XFCE session, perhaps searching
for
xfce*in the sessions list. Also handle lack of session or failure to start session gracefully. At the moment it just stays on the
welcome` screen forever. Same goes for classic logon.