@@ -83,7 +83,16 @@ bool Greeter::isAuthenticated() const
8383QString Greeter::authenticationUser() const
8484{
8585 Q_D(const Greeter);
86− return d->m_greeter->authenticationUser();
86+ return d->cachedAuthUser;
87+}
88+
89+void Greeter::checkAuthenticationUser()
90+{
91+ Q_D(Greeter);
92+ if (d->cachedAuthUser != d->m_greeter->authenticationUser()) {
93+ d->cachedAuthUser = d->m_greeter->authenticationUser();
94+ Q_EMIT authenticationUserChanged();
95+ }
8796}
8897
8998QString Greeter::defaultSessionHint() const
@@ -144,7 +153,7 @@ void Greeter::authenticate(const QString &username)
144153 }
145154
146155 Q_EMIT isAuthenticatedChanged();
147− Q_EMIT authenticationUserChanged();
156+ checkAuthenticationUser();
148157}
149158
150159void Greeter::respond(const QString &response)
@@ -164,7 +173,7 @@ void Greeter::showPromptFilter(const QString &text, QLightDM::Greeter::PromptTyp
164173 Q_D(Greeter);
165174 d->wasPrompted = true;
166175
167− Q_EMIT authenticationUserChanged(); // may have changed in liblightdm
176+ checkAuthenticationUser(); // may have changed in liblightdm
168177
169178 bool isDefaultPrompt = (text == dgettext("Linux-PAM", "Password: "));
170179
@@ -185,7 +194,7 @@ void Greeter::showPromptFilter(const QString &text, QLightDM::Greeter::PromptTyp
185194
186195void Greeter::showMessageFilter(const QString &text, QLightDM::Greeter::MessageType type)
187196{
188− Q_EMIT authenticationUserChanged(); // may have changed in liblightdm
197+ checkAuthenticationUser(); // may have changed in liblightdm
189198 Q_EMIT showMessage(text, type == QLightDM::Greeter::MessageTypeError);
190199}
191200