@@ -29,12 +29,18 @@ public:
2929 bool authenticated = false;
3030 QString authenticationUser;
3131 bool twoFactorDone = false;
32+ QTimer authCallbackTimer;
3233};
3334
3435Greeter::Greeter(QObject *parent)
3536 : QObject(parent)
3637 , d_ptr(new GreeterPrivate)
3738{
39+ Q_D(Greeter);
40+
41+ d->authCallbackTimer.setSingleShot(true);
42+ connect(&d->authCallbackTimer, &QTimer::timeout,
43+ this, &QLightDM::Greeter::handleAuthenticate);
3844}
3945
4046Greeter::~Greeter()
@@ -134,7 +140,7 @@ void Greeter::authenticate(const QString &username)
134140 d->authenticated = false;
135141 d->authenticationUser = username;
136142 d->twoFactorDone = false;
137− QTimer::singleShot(0, this, &Greeter::handleAuthenticate);
143+ d->authCallbackTimer.start();
138144}
139145
140146void Greeter::handleAuthenticate()
@@ -190,7 +196,7 @@ void Greeter::authenticateAsGuest()
190196 d->authenticated = true;
191197 d->authenticationUser = QString(); // this is what the real liblightdm does
192198 d->twoFactorDone = false;
193− QTimer::singleShot(0, this, &Greeter::authenticationComplete);
199+ d->authCallbackTimer.start();
194200}
195201
196202void Greeter::authenticateAutologin()
@@ -203,7 +209,10 @@ void Greeter::authenticateRemote(const QString &session, const QString &username
203209}
204210
205211void Greeter::cancelAuthentication()
206−{}
212+{
213+ Q_D(Greeter);
214+ d->authCallbackTimer.stop();
215+}
207216
208217void Greeter::setLanguage (const QString &language)
209218{