Skip to content

Commit b426c75

Browse files
chore: 同步gerrit代码到github
chore: 修改插件编程指南 补充缺失的接口函数和消息协议,优化文档格式和内容 Log: Influence: 修改文档,不涉及功能 Change-Id: I09efad1622a9c2f9c4e5d6d121fd644594114992 (cherry picked from commit cb89e7ca3e63f72cbcd8b3958a256bd813ef9d53) feat: 删除写入到cache里面的日志 锁屏的日志已经写入到journal了,无需向cache目录重复写入日志 Log: 日志不再写入到cache目录 Influence: 日志 Task: https://pms.uniontech.com/task-view-379327.html Change-Id: I2ba0c2d10ff3f12cb50577bd4d853f06df28d6fe (cherry picked from commit 4f21e8889ffd8939f803240c898bde278b047507) feat: 控制台日志只在调试模式下输出 发布模式下不输出控制台日志 Log: 控制台日志只在调试模式下输出 Influence: 日志 Task: https://pms.uniontech.com/task-view-379327.html Change-Id: I8c439d34c2807dc7a0ae7cc138c4d7b9ad929fc5 (cherry picked from commit de95b99e757a2ef3331b46809dc55af2fef4f1b0) fix: 【DDE】【终端锁定】开启自动登录和无密码登录,终端锁定后,登录按钮未置灰显示 无密码认证时,需要同时考虑终端锁定的情况 Bug: https://pms.uniontech.com/bug-view-268089.html Log: 修复开启自动登录和无密码登录,终端锁定后,登录按钮未置灰显示问题 Change-Id: Ibd733db31f05bbb592a4be28d93ffba103805d40 (cherry picked from commit 954e344d7e32ccd0ee6732635711cff01fd4257c) (cherry picked from commit c59d73173a38b1cd7607c2bffde9565ad4a2822f) fix: 待机信号处理中考虑其它流程设置的可见性 有些流程需要内置黑屏,所以可能在未锁定时拉起lock Log: 响应唤醒时,处理可见性 Bug: https://pms.uniontech.com/bug-view-314491.html Change-Id: I9bd6171cc7dc3bb58223d20dbb8bb40aa39c9f9b (cherry picked from commit eb18a13d0a2b1a18e30fa5785dda72093bad4b8f) (cherry picked from commit e32cd5b00206307a187be1b0c77e96aa380b2173) feat: 切换用户界面待机唤醒时进入锁屏界面 切换用户界面属于进入锁屏,唤起时仍进入锁屏界面,需输入密码进入系统 Log: Task: https://pms.uniontech.com/task-view-379555.html Influence: 切换用户界面待机唤醒,以及各种和切换用户界面相关的逻辑 Change-Id: I382ba9e764c17a39627ac2099eda95bfc526901a (cherry picked from commit eb1221425988cdb7469ff0fc479ba3927df0dd1d) fix: 极端情况无法获取到后端账户User列表信息,将页面显示成输入密码和账户的情况 极端情况无法获取到后端账户User列表信息,将页面显示成输入密码和账户的情况 Log: 极端情况无法获取到后端账户User列表信息,将页面显示成输入密码和账户的情况 Influence: 获取不到账户信息是greeter崩溃 Bug: https://pms.uniontech.com/bug-view-322207.html Change-Id: Ib0a3717f5a1e6d24f97d424d651d6a9c2398744d (cherry picked from commit ebb3a2e3839821a759598a17c02fbb460595e865) fix: 登录界面显示两个重置密码弹窗 auth_password新建后,旧的析构未有检测重置密码弹窗,如果有,则应该关闭和释放内存。 Log: as title Influence: 重置密码弹窗显示一个 Bug: https://pms.uniontech.com/bug-view-255785.html Change-Id: I49233803cb1347606c5cbdb600bd4c73b605009d (cherry picked from commit e44decfc7c1aa030a721059880955c41f34a0810) fix: 如果开启了Checkpwd配置,关机时不能显示关机黑屏 如果开启了Checkpwd配置,关机时不能显示关机黑屏 以前增加关机黑屏,是为了解决关机、重启闪屏,但是未考虑到关机还有一个gsettings配置checkpwd Log: 如果开启了Checkpwd配置,关机时不能显示关机黑屏 Influence: 开启配置关机 Bug: https://pms.uniontech.com/bug-view-328319.html Change-Id: I35cc895ae8e49795c00e42e774a3ace623ba4849 (cherry picked from commit 5df869bafb8c0a1022161610e8f343a1ccc50bc9) fix: 修复密码错误详细弹框UI问题 1. 密码错误详细弹框UI高度过高 Log: 高倍缩放(大于1倍)下,登录或锁屏界面下,密码错误的tooltip提示显示异常 Influence: 密码错误详细弹框 Bug: https://pms.uniontech.com/bug-view-328583.html Change-Id: I47bd8e29b9df22fe25565f4960ac3477bfe88aff (cherry picked from commit c8d180c73cb525affe499114939a5985a1ef66e0) chore: 避免频繁通过接口查询错误提示框使能状态 没有必要的接口频繁调用 Change-Id: I3ec38657fd9337f5bd666035ecda25b914ba9c4c (cherry picked from commit 6d30c6b4a51886c7ab4fe822c1f8eabe56a27663) fix: 重新修改免密登录待机唤醒场景 1. 锁屏界面待机时,唤醒进入锁屏免密界面 2. 关机界面待机时,唤醒进入桌面 Log: 【通用】关闭待机恢复时需要密码开关,开启免密登录开关,在桌面待机唤醒后,显示锁屏界面,没有直接进入桌面 Influence: 免密待机唤醒 Bug: https://pms.uniontech.com/bug-view-330173.html Change-Id: Ie6417fb0bd09bd397094e14b13e683b61b79a855 (cherry picked from commit 59c4c850fd0faab07f1482e6cb784c4c4ef5ddb3) fix: 处理缩放和当前屏幕不匹配的情况 启动greeter之前判断下从配置文件中获取缩放和当前屏幕是否匹配,如果不匹配则用默认缩放1 这个只能处理启动greeter前插入屏幕的场景,greeter启动后插入和当前缩放不匹配的屏幕无法处理。 Log: Bug: https://pms.uniontech.com/bug-view-331209.html Influence: 登录界面缩放(设计多种缩放比,最好用4K屏幕测试),多屏缩放比(相同分辨率屏幕和不同分辨率屏幕都需要测试) Change-Id: I4fd3cb3c616f877d5b0d134170e0d96dd7dbd896 (cherry picked from commit 813f345c203ad4b47356c10367a923e379bf65c8) chore: 手势插件安装问题 明确dconfig配置文件归属,避免产生安装时文件冲突问题 Change-Id: I6185df3bd1a9541d6f56b22a71bffa889d03a5bd (cherry picked from commit d09727b0745c92f18cb3d445e6bb9069ebb232b8) fix: 修复pgy待机唤醒过程中mouseRelease造成锁屏隐藏的问题 触发了WarningContent的展示,后响应鼠标事件隐藏锁屏 Log: 调整显示流程 Influence: 修复问题 Bug: https://pms.uniontech.com/bug-view-331651.html Change-Id: I413352c235207ff8830f764dc0ddebe7aae2d81c (cherry picked from commit 31cf025ab5d3cd29cd9b4027a5d42068c148b352) fix: 修复唤醒过程中频繁点击造成锁屏隐藏的问题 存在两个方面的影响: 1 UI设置不正确(显示WarningContent) 2 外部设置的lock状态导致判断条件不满足 Log: 调整逻辑 Influence: 修复问题 Bug: https://pms.uniontech.com/bug-view-331651.html Change-Id: I086a236255e9ceeacee4adfa587f3ba33a6a8ad7 (cherry picked from commit a0368c0fd23021c7b0bfba47e9f1b185f08c7a87) chore: 增加显示登录框的日志 增加显示登录框的日志,用以后面分析问题 Log: Influence: 无功能影响 Change-Id: I060771e650780cff4ac5b02272f4974aeaedaa39 (cherry picked from commit 0a62937301974e8ad92222b9f0559d0253b2a51d)
1 parent 68e0b72 commit b426c75

16 files changed

Lines changed: 930 additions & 473 deletions

debian/dde-session-shell.install

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ etc
22
usr/bin
33
usr/share/applications
44
usr/share/deepin-debug-config
5-
usr/share/dsg
5+
usr/share/dsg/configs/org.deepin.dde.lightdm-deepin-greeter/org.deepin.dde.lightdm-deepin-greeter.json
6+
usr/share/dsg/configs/org.deepin.dde.lock/org.deepin.dde.lock.json
67
usr/share/glib-2.0
78
usr/share/xgreeters
89
usr/share/dbus-1

docs/development-guide.md

Lines changed: 659 additions & 353 deletions
Large diffs are not rendered by default.

src/app/dde-lock.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ int main(int argc, char *argv[])
8686
});
8787

8888
DLogManager::setLogFormat("%{time}{yyyy-MM-dd, HH:mm:ss.zzz} [%{type:-7}] [ %{function:-35} %{line}] %{message}\n");
89+
#ifdef QT_DEBUG
8990
DLogManager::registerConsoleAppender();
90-
DLogManager::registerFileAppender();
91+
#endif
9192
DLogManager::registerJournalAppender();
9293

9394
QCommandLineParser cmdParser;
@@ -203,6 +204,7 @@ int main(int argc, char *argv[])
203204
QObject::connect(WarningContent::instance(), &WarningContent::requestLockFrameHide, [model] {
204205
model->setVisible(false);
205206
});
207+
QObject::connect(LockContent::instance(), &LockContent::requestLockStateChange, worker, &LockWorker::setLocked);
206208

207209
auto createFrame = [&](QPointer<QScreen> screen, int count) -> QWidget* {
208210
LockFrame *lockFrame = new LockFrame(model);

src/app/greeter-display-setting.cpp

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,65 @@ static double calcMaxScaleFactor(unsigned int width, unsigned int height) {
108108
return maxScale;
109109
}
110110

111+
static QStringList getScaleList()
112+
{
113+
qDebug() << "Get scale list";
114+
Display *display = XOpenDisplay(nullptr);
115+
if (!display) {
116+
qWarning() << "Display is null";
117+
return QStringList{};
118+
}
119+
120+
XRRScreenResources *resources = XRRGetScreenResourcesCurrent(display, DefaultRootWindow(display));
121+
if (!resources) {
122+
resources = XRRGetScreenResources(display, DefaultRootWindow(display));
123+
qCWarning(DDE_SHELL) << "Get current XRR screen resources failed, instead of getting XRR screen resources, resources: " << resources;
124+
}
125+
126+
static const float MinScreenWidth = 1024.0f;
127+
static const float MinScreenHeight = 768.0f;
128+
static const QStringList tvstring = {"1.0", "1.25", "1.5", "1.75", "2.0", "2.25", "2.5", "2.75", "3.0"};
129+
QStringList fscaleList;
130+
131+
if (resources) {
132+
for (int i = 0; i < resources->noutput; i++) {
133+
XRROutputInfo* outputInfo = XRRGetOutputInfo(display, resources, resources->outputs[i]);
134+
if (outputInfo->crtc == 0 || outputInfo->mm_width == 0)
135+
continue;
136+
137+
XRRCrtcInfo *crtInfo = XRRGetCrtcInfo(display, resources, outputInfo->crtc);
138+
if (crtInfo == nullptr)
139+
continue;
140+
141+
auto maxWScale = crtInfo->width / MinScreenWidth;
142+
auto maxHScale = crtInfo->height / MinScreenHeight;
143+
auto maxScale = maxWScale < maxHScale ? maxWScale : maxHScale;
144+
maxScale = maxScale < 3.0f ? maxScale : 3.0f;
145+
if (fscaleList.isEmpty()) {
146+
for (int idx = 0; idx * 0.25f + 1.0f <= maxScale; ++idx) {
147+
fscaleList << tvstring[idx];
148+
}
149+
qDebug() << "First screen scale list:" << fscaleList;
150+
} else {
151+
QStringList tmpList;
152+
for (int idx = 0; idx * 0.25f + 1.0f <= maxScale; ++idx) {
153+
tmpList << tvstring[idx];
154+
}
155+
qDebug() << "Current screen scale list:" << tmpList;
156+
// fscaleList、tmpList两者取交集
157+
for (const auto &scale : fscaleList) {
158+
if (!tmpList.contains(scale))
159+
fscaleList.removeAll(scale);
160+
}
161+
}
162+
}
163+
} else {
164+
qCWarning(DDE_SHELL) << "Get scale factor failed, please check X11 Extension";
165+
}
166+
167+
return fscaleList;
168+
}
169+
111170
static double getScaleFactor() {
112171
Display *display = XOpenDisplay(nullptr);
113172
double scaleFactor = 0.0;
@@ -199,6 +258,14 @@ double getScaleFormConfig()
199258
qDebug() << "Scale factor from system display config: " << scaleFactor;
200259
if(scaleFactor == 0.0) {
201260
scaleFactor = defaultScaleFactor;
261+
} else {
262+
// 处理关机期间从高分屏换到低分屏的场景
263+
const auto &scales = getScaleList();
264+
qDebug() << "Scales:" << scales;
265+
if (!scales.isEmpty() && !scales.contains(QString::number(scaleFactor, 'f', 2).replace("00", "0"))) {
266+
qInfo() << "Scale factor is not in scales, use default scale factor";
267+
scaleFactor = defaultScaleFactor;
268+
}
202269
}
203270
return scaleFactor;
204271
} else {

src/dde-lock/lockworker.cpp

Lines changed: 99 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,39 @@ void LockWorker::initConnections()
190190
const bool sleepLock = isSleepLock();
191191
#endif
192192
qCInfo(DDE_SHELL) << "Lock screen when system wakes up: " << sleepLock << ", is visible:" << m_model->visible();
193+
194+
FullScreenBackground::setContent(LockContent::instance());
195+
m_model->setCurrentContentType(SessionBaseModel::LockContent);
196+
193197
if (isSleep) {
194-
endAuthentication(m_account, AT_All);
195-
destroyAuthentication(m_account);
196198
checkSystemWakeupTimer->start();
197199
doSuspendTime = QDateTime::currentDateTime();
198-
} else {
199-
// 非黑屏mode
200-
m_model->setIsBlackMode(isSleep);
201-
202-
// 如果待机唤醒后需要密码则创建验证
203-
if(m_login1SessionSelf->active() && sleepLock)
204-
createAuthentication(m_model->currentUser()->name());
205-
}
206-
if (!m_model->visible() && sleepLock) {
207-
m_model->setIsBlackMode(isSleep);
208-
m_model->setVisible(true);
209-
}
200+
m_model->setIsBlackMode(true);
201+
// 休眠时按需拉起锁屏,注意此时是被动响应休眠
202+
if (sleepLock && m_login1SessionSelf->active()) {
203+
// 仅sleepLock配置开启时执行
204+
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::PasswordMode);
205+
setLocked(true);
206+
m_model->setVisible(true);
210207

211-
if (!isSleep && !sleepLock) {
212-
//待机唤醒后检查是否需要密码,若不需要密码直接隐藏锁定界面
213-
m_model->setVisible(false);
208+
qCInfo(DDE_SHELL) << "locked for sleepLock config";
209+
}
210+
} else {
211+
SessionBaseModel::ModeStatus status = m_model->currentModeState();
212+
if (isLocked() || (m_model->isNoPasswordLogin() && (status == SessionBaseModel::ModeStatus::PowerMode || status == SessionBaseModel::ModeStatus::PasswordMode))) {
213+
// 唤醒时如果处于lock状态,重置认证
214+
if (m_login1SessionSelf->active()) {
215+
endAuthentication(m_account, AT_All);
216+
destroyAuthentication(m_account);
217+
createAuthentication(m_model->currentUser()->name());
218+
}
219+
} else {
220+
// 处理其他流程设置的可见状态
221+
m_model->setVisible(false);
222+
}
223+
// 避免在电源选项处理中设置密码模式,会导致唤醒后闪锁屏
224+
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::PasswordMode);
225+
m_model->setIsBlackMode(false);
214226
}
215227
emit m_model->prepareForSleep(isSleep);
216228
});
@@ -286,40 +298,50 @@ void LockWorker::initConnections()
286298

287299
void LockWorker::initData()
288300
{
289-
/* com.deepin.daemon.Accounts */
290-
m_model->updateUserList(m_accountsInter->userList());
291-
m_model->updateLoginedUserList(m_loginedInter->userList());
292-
293-
m_model->setUserlistVisible(valueByQSettings<bool>("", "userlist", true));
294-
/* com.deepin.udcp.iam */
295-
QDBusInterface ifc(DSS_DBUS::udcpIamService, DSS_DBUS::udcpIamPath, DSS_DBUS::udcpIamService, QDBusConnection::systemBus(), this);
296-
const bool allowShowCustomUser = (!m_model->userlistVisible()) || valueByQSettings<bool>("", "loginPromptInput", false) ||
297-
ifc.property("Enable").toBool() || checkIsADDomain();
298-
m_model->setAllowShowCustomUser(allowShowCustomUser);
299-
300-
/* init server user or custom user */
301-
if (DSysInfo::deepinType() == DSysInfo::DeepinServer || m_model->allowShowCustomUser()) {
302-
std::shared_ptr<User> user(new User());
303-
m_model->setIsServerModel(DSysInfo::deepinType() == DSysInfo::DeepinServer);
304-
m_model->addUser(user);
305-
}
301+
auto list = m_accountsInter->userList();
302+
if (!list.isEmpty()) {
303+
/* com.deepin.daemon.Accounts */
304+
m_model->updateUserList(m_accountsInter->userList());
305+
m_model->updateLoginedUserList(m_loginedInter->userList());
306+
307+
m_model->setUserlistVisible(valueByQSettings<bool>("", "userlist", true));
308+
/* com.deepin.udcp.iam */
309+
QDBusInterface ifc(DSS_DBUS::udcpIamService, DSS_DBUS::udcpIamPath, DSS_DBUS::udcpIamService, QDBusConnection::systemBus(), this);
310+
const bool allowShowCustomUser = (!m_model->userlistVisible()) || valueByQSettings<bool>("", "loginPromptInput", false) ||
311+
ifc.property("Enable").toBool() || checkIsADDomain();
312+
m_model->setAllowShowCustomUser(allowShowCustomUser);
313+
314+
/* init server user or custom user */
315+
if (DSysInfo::deepinType() == DSysInfo::DeepinServer || m_model->allowShowCustomUser()) {
316+
std::shared_ptr<User> user(new User());
317+
m_model->setIsServerModel(DSysInfo::deepinType() == DSysInfo::DeepinServer);
318+
m_model->addUser(user);
319+
}
306320

307-
/* com.deepin.dde.LockService */
308-
std::shared_ptr<User> user_ptr = m_model->findUserByUid(getuid());
309-
if (user_ptr.get()) {
310-
m_model->updateCurrentUser(user_ptr);
311-
const QString &userJson = m_lockInter->CurrentUser();
312-
QJsonParseError jsonParseError;
313-
const QJsonDocument userDoc = QJsonDocument::fromJson(userJson.toUtf8(), &jsonParseError);
314-
if (jsonParseError.error != QJsonParseError::NoError || userDoc.isEmpty()) {
315-
qCWarning(DDE_SHELL) << "Failed to obtain current user information from lock service!";
321+
/* com.deepin.dde.LockService */
322+
std::shared_ptr<User> user_ptr = m_model->findUserByUid(getuid());
323+
if (user_ptr.get()) {
324+
m_model->updateCurrentUser(user_ptr);
325+
const QString &userJson = m_lockInter->CurrentUser();
326+
QJsonParseError jsonParseError;
327+
const QJsonDocument userDoc = QJsonDocument::fromJson(userJson.toUtf8(), &jsonParseError);
328+
if (jsonParseError.error != QJsonParseError::NoError || userDoc.isEmpty()) {
329+
qCWarning(DDE_SHELL) << "Failed to obtain current user information from lock service!";
330+
} else {
331+
const QJsonObject userObj = userDoc.object();
332+
m_model->currentUser()->setLastAuthType(AUTH_TYPE_CAST(userObj["AuthType"].toInt()));
333+
m_model->currentUser()->setLastCustomAuth(userObj["LastCustomAuth"].toString());
334+
}
316335
} else {
317-
const QJsonObject userObj = userDoc.object();
318-
m_model->currentUser()->setLastAuthType(AUTH_TYPE_CAST(userObj["AuthType"].toInt()));
319-
m_model->currentUser()->setLastCustomAuth(userObj["LastCustomAuth"].toString());
336+
m_model->updateCurrentUser(m_lockInter->CurrentUser());
320337
}
321338
} else {
322-
m_model->updateCurrentUser(m_lockInter->CurrentUser());
339+
qCWarning(DDE_SHELL) << "dbus com.deepin.daemon.Accounts userList is empty, use ...";
340+
341+
std::shared_ptr<User> user(new User());
342+
m_model->addUser(user);
343+
m_model->updateCurrentUser(user);
344+
m_model->setAllowShowCustomUser(true);
323345
}
324346

325347
/* com.deepin.daemon.Authenticate */
@@ -343,6 +365,8 @@ void LockWorker::initConfiguration()
343365
m_model->setAllowShowUserSwitchButton(getDconfigValue("switchUser", Ondemand).toInt() == AuthInterface::Ondemand);
344366
#endif
345367

368+
m_model->setGsCheckpwd(isCheckPwdBeforeRebootOrShut());
369+
346370
checkPowerInfo();
347371
}
348372

@@ -490,7 +514,6 @@ void LockWorker::doPowerAction(const SessionBaseModel::PowerAction action)
490514
case SessionBaseModel::PowerAction::RequireSuspend:
491515
{
492516
m_model->setIsBlackMode(true);
493-
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::PasswordMode);
494517

495518
int delayTime = 500;
496519
#ifndef ENABLE_DSS_SNIPE
@@ -520,7 +543,6 @@ void LockWorker::doPowerAction(const SessionBaseModel::PowerAction action)
520543
case SessionBaseModel::PowerAction::RequireHibernate:
521544
{
522545
m_model->setIsBlackMode(true);
523-
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::PasswordMode);
524546

525547
int delayTime = 500;
526548
#ifndef ENABLE_DSS_SNIPE
@@ -549,42 +571,44 @@ void LockWorker::doPowerAction(const SessionBaseModel::PowerAction action)
549571
}
550572
}
551573
break;
552-
case SessionBaseModel::PowerAction::RequireRestart:
574+
case SessionBaseModel::PowerAction::RequireRestart: {
553575
m_model->setShutdownMode(true);
576+
auto gsCheckPwd = m_model->gsCheckpwd();
577+
if (!isLocked() || m_model->currentModeState() == SessionBaseModel::ModeStatus::ShutDownMode || !gsCheckPwd) {
578+
m_sessionManagerInter->RequestReboot();
579+
} else {
580+
createAuthentication(m_account);
581+
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::ConfirmPasswordMode);
582+
}
554583

555-
QTimer::singleShot(350, this, [=] {
556-
if (!isLocked() || m_model->currentModeState() == SessionBaseModel::ModeStatus::ShutDownMode || !isCheckPwdBeforeRebootOrShut()) {
557-
m_sessionManagerInter->RequestReboot();
558-
} else {
559-
createAuthentication(m_account);
560-
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::ConfirmPasswordMode);
561-
}
562-
563-
if (m_model->visibleShutdownWhenRebootOrShutdown()) {
564-
return;
565-
}
584+
if (m_model->visibleShutdownWhenRebootOrShutdown()) {
585+
return;
586+
}
566587

588+
if (!gsCheckPwd)
567589
m_model->setVisible(false);
568-
});
590+
569591
return;
570-
case SessionBaseModel::PowerAction::RequireShutdown:
592+
}
593+
case SessionBaseModel::PowerAction::RequireShutdown: {
571594
m_model->setShutdownMode(true);
595+
auto gsCheckPwd = m_model->gsCheckpwd();
596+
if (!isLocked() || m_model->currentModeState() == SessionBaseModel::ModeStatus::ShutDownMode || !gsCheckPwd) {
597+
m_sessionManagerInter->RequestShutdown();
598+
} else {
599+
createAuthentication(m_account);
600+
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::ConfirmPasswordMode);
601+
}
572602

573-
QTimer::singleShot(350, this, [=] {
574-
if (!isLocked() || m_model->currentModeState() == SessionBaseModel::ModeStatus::ShutDownMode || !isCheckPwdBeforeRebootOrShut()) {
575-
m_sessionManagerInter->RequestShutdown();
576-
} else {
577-
createAuthentication(m_account);
578-
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::ConfirmPasswordMode);
579-
}
580-
581-
if (m_model->visibleShutdownWhenRebootOrShutdown()) {
582-
return;
583-
}
603+
if (m_model->visibleShutdownWhenRebootOrShutdown()) {
604+
return;
605+
}
584606

607+
if (!gsCheckPwd)
585608
m_model->setVisible(false);
586-
});
609+
587610
return;
611+
}
588612
case SessionBaseModel::PowerAction::RequireLock:
589613
m_model->setCurrentModeState(SessionBaseModel::ModeStatus::PasswordMode);
590614
createAuthentication(m_model->currentUser()->name());

src/dde-lock/lockworker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public slots:
6868

6969
void onNoPasswordLoginChanged(const QString &account, bool noPassword);
7070
void sendExtraInfo(const QString &account, AuthCommon::AuthType authType, const QString &info);
71+
void setLocked(const bool locked);
7172

7273
private:
7374
void initConnections();
@@ -76,7 +77,6 @@ public slots:
7677

7778
void doPowerAction(const SessionBaseModel::PowerAction action);
7879
void setCurrentUser(const std::shared_ptr<User> user);
79-
void setLocked(const bool locked);
8080

8181
// lock
8282
void lockServiceEvent(quint32 eventType, quint32 pid, const QString &username, const QString &message);

0 commit comments

Comments
 (0)