rharish101 / ReGreet

Clean and customizable greeter for greetd
GNU General Public License v3.0
375 stars 17 forks source link

Logging in... takes ~5 seconds #18

Closed TheSunCat closed 1 year ago

TheSunCat commented 1 year ago

After typing in my password, actually starting the session takes around 5 seconds (about as long as it would take to tell me my password is wrong). During this time, the text changes to "Logging in..." and I can still control the mouse and type into the password field. I'm using the default config, and the contents of /var/log/regreet/log have nothing from recent boots.

rharish101 commented 1 year ago

Can you run ReGreet with -l debug and upload the logs? That way you'll get debug logs as well.

fufexan commented 1 year ago

I am experiencing the same issue. Here's my latest log regreet.log.

JohnnyJayJay commented 1 year ago

So, the reason for this (as far as I can tell) is that ReGreet simply does not terminate at all when getting a successful response from greetd, instead it just waits for greetd to kill it, which happens to take exactly 5 seconds.

This should be easy enough to fix - how about we move the "Logging in..." message before sending a session start to greetd and then exiting the process with code 0?

Now, it might be a good idea to also adjust the cache-saving behaviour, since technically it is currently a race condition to do tasks after receiving a successful response from greetd. We could maybe save it before asking greetd to start the session and then restore the old values in case something goes wrong.

I could implement this tomorrow or so.

rharish101 commented 1 year ago

Thanks for the diagnosis! Feel free to make a PR if you want to, else I'll try to do it when I get time.