-
Notifications
You must be signed in to change notification settings - Fork 34
fix: fix user cannot unlock after lockscreen #674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,13 +33,12 @@ | |||||||||||||||||||||||||
| #include <Messages.h> | ||||||||||||||||||||||||||
| #include <SocketWriter.h> | ||||||||||||||||||||||||||
| #include <security/pam_appl.h> | ||||||||||||||||||||||||||
| #include <pwd.h> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #include <DDBusSender> | ||||||||||||||||||||||||||
| #include <DThreadUtils> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #include <QCommandLineOption> | ||||||||||||||||||||||||||
| #include <QCommandLineParser> | ||||||||||||||||||||||||||
| #include <QGuiApplication> | ||||||||||||||||||||||||||
| #include <QLocalSocket> | ||||||||||||||||||||||||||
| #include <QVariantMap> | ||||||||||||||||||||||||||
|
|
@@ -212,20 +211,6 @@ | |||||||||||||||||||||||||
| "SessionRemoved", | ||||||||||||||||||||||||||
| this, | ||||||||||||||||||||||||||
| SLOT(onSessionRemoved(QString, QDBusObjectPath))); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Use async call to avoid blocking | ||||||||||||||||||||||||||
| QThreadPool::globalInstance()->start([this, conn]() { | ||||||||||||||||||||||||||
| OrgFreedesktopLogin1ManagerInterface manager(Logind::serviceName(), | ||||||||||||||||||||||||||
| Logind::managerPath(), | ||||||||||||||||||||||||||
| conn); | ||||||||||||||||||||||||||
| auto reply = manager.ListSessions(); | ||||||||||||||||||||||||||
| reply.waitForFinished(); | ||||||||||||||||||||||||||
| if (reply.isValid()) { | ||||||||||||||||||||||||||
| auto sessions = reply.value(); | ||||||||||||||||||||||||||
| for (const auto &session : sessions) | ||||||||||||||||||||||||||
| onSessionNew(session.sessionId, session.sessionPath); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| void GreeterProxy::login(const QString &user, const QString &password, const int sessionIndex) | ||||||||||||||||||||||||||
|
|
@@ -306,12 +291,12 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| void GreeterProxy::updateUserLoginState(const QDBusObjectPath &path, bool loggedIn) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| QThreadPool ::globalInstance()->start([this, path, loggedIn] { | ||||||||||||||||||||||||||
| QThreadPool::globalInstance()->start([this, path, loggedIn] { | ||||||||||||||||||||||||||
| OrgFreedesktopLogin1SessionInterface session(Logind::serviceName(), | ||||||||||||||||||||||||||
| path.path(), | ||||||||||||||||||||||||||
| QDBusConnection ::systemBus()); | ||||||||||||||||||||||||||
| QString username = QString::fromLocal8Bit(getpwuid(session.user().userId)->pw_name); | ||||||||||||||||||||||||||
| DThreadUtils::gui().run(this, [this, username, loggedIn]() { | ||||||||||||||||||||||||||
| QDBusConnection::systemBus()); | ||||||||||||||||||||||||||
| QString username = session.name(); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| QString username = session.name(); | |
| if (!session.isValid()) { | |
| qCWarning(treelandGreeter) << "Failed to create logind session interface for path" | |
| << path.path(); | |
| return; | |
| } | |
| const QString username = session.name(); | |
| if (username.isEmpty()) { | |
| qCWarning(treelandGreeter) << "Received empty username from logind session for path" | |
| << path.path(); | |
| return; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing include for QThreadPool. The code uses QThreadPool::globalInstance() but does not include the necessary header. Add
#include <QThreadPool>to the includes section to ensure proper compilation.缺少 QThreadPool 的头文件包含。代码使用了 QThreadPool::globalInstance() 但没有包含必要的头文件。请在包含部分添加
#include <QThreadPool>以确保正确编译。