Repository navigation
fix: gate Greeter account entry on the user notice - #591
deepin-bot[bot] merged 1 commit into
Conversation
Reviewer's GuideData structuresExpose the Greeter activity and account-entry signals and state needed to coordinate session reactivation with the UI.
APIAdd the overridable user-switch hook and route the control widget’s switch request through it.
Uses of the APIConnect Greeter session events to account-entry UI state and initialize login-window visibility through the new gate.
ImplementationWatch login1 session activity and preserve the account input when a reused Greeter session is removed or reactivated.
Implement account-entry task selection, execution, pending-state handling, and return to the account input page.
UIGate login-window visibility and input while account-entry work is pending or the Greeter is inactive, keeping the background and virtual keyboard in sync.
ConfigurationInstall the account-entry task helper only when the associated feature is enabled.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 6 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/lightdm-deepin-greeter/logincontent.cpp" line_range="138" />
<code_context>
}
loginFrame->setScreen(screen, count <= 0);
QObject::connect(worker, &GreeterWorker::requestUpdateBackground, loginFrame, &LoginWindow::updateBackground);
</code_context>
<issue_to_address>
**Login controls stay hidden**
When a registered checker hangs while the Greeter deactivates, `setGreeterActive(false)` does not kill the selector because its `ForwardedErrorChannel` mode does not match the `ForwardedChannels` check. `reactivateAccountEntry()` then waits for the still-running process, so the finish handler never restores the login controls.
Kill the selector when the Greeter deactivates, regardless of its process channel mode, and let reactivation resume the account-entry flow.
Also at `src/lightdm-deepin-greeter/logincontent.cpp:136-137`, `src/lightdm-deepin-greeter/logincontent.cpp:146`.
</issue_to_address>
### Comment 2
<location path="src/lightdm-deepin-greeter/logincontent.cpp" line_range="166" />
<code_context>
+
+ const QDir configs(QStringLiteral("/usr/share/dde-session-shell/greeters.d/account-entry.conf.d"));
+ if (configs.entryList({QStringLiteral("*.json")}, QDir::Files).isEmpty()) {
+ enterAccountInput();
+ emit accountEntryVisibilityChanged();
+ } else {
</code_context>
<issue_to_address>
**Account entry appears without its notice**
When the selector or configured task cannot start, exits unsuccessfully, or produces unusable output, the finish handler falls through to `enterAccountInput()` while the Greeter is active, so the account-entry page appears without the configured task completing; selector exit code 1 is also not logged.
Validate the selector result and task completion before calling `enterAccountInput()`, and log selector exit code 1.
</issue_to_address>
### Comment 3
<location path="src/lightdm-deepin-greeter/greeterworker.cpp" line_range="421-428" />
<code_context>
+#ifdef ENABLE_DSS_SNIPE
+void GreeterWorker::watchSessionActivity()
+{
+ if (!m_login1SessionSelf || !m_login1SessionSelf->isValid())
+ return;
+
+ if (!QDBusConnection::systemBus().connect(m_login1SessionSelf->service(), m_login1SessionSelf->path(),
</code_context>
<issue_to_address>
**Reused Greeter skips the notice**
When the login1 session proxy is invalid or the PropertiesChanged subscription fails, `watchSessionActivity()` returns without activity tracking or a reactivation signal, so `LoginContent` retains its default active state and the reused Greeter can show the account-entry page without running the registered task.
Provide a fallback or retry for activity tracking so a reused Greeter receives the reactivation signal and runs the registered task.
</issue_to_address>
### Comment 4
<location path="src/lightdm-deepin-greeter/loginwindow.cpp" line_range="55" />
<code_context>
+ if (blocked && ownsContent) {
+ login->hide();
+ if (!m_model->isUseWayland() && windowHandle())
+ windowHandle()->setKeyboardGrabEnabled(false);
+ }
+
</code_context>
<issue_to_address>
**Keyboard grab stays disabled**
When the account-entry task or an inactive Greeter causes the blocked branch to run on X11, `updateLoginVisibility()` disables the X11 keyboard grab while the account-entry flow is blocked, but does not restore it when the flow unblocks; the Greeter then stops reserving keyboard input and keystrokes can reach other X clients.
Restore the keyboard grab when the Greeter becomes unblocked and visible, subject to the existing grab-state requirements.
</issue_to_address>
### Comment 5
<location path="src/lightdm-deepin-greeter/loginwindow.cpp" line_range="89-92" />
<code_context>
bool LoginWindow::event(QEvent *event)
{
+ if ((event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
+ && LoginContent::instance()->accountEntryBlocksLogin()) {
+ event->accept();
+ return true;
+ }
+
</code_context>
<issue_to_address>
**Power shortcuts stop during notice**
When an account-entry task is running and the user invokes a Greeter power shortcut, the early return consumes every key press and release while the account-entry task runs, including `Key_Sleep` and `Key_PowerOff`; `LoginWindow::event` therefore never reaches its existing handlers for those keys, so users cannot invoke those Greeter power actions during the task.
Allow the existing power-key handlers to run before consuming other key events while login is blocked.
</issue_to_address>
### Comment 6
<location path="src/lightdm-deepin-greeter/greeterworker.cpp" line_range="473" />
<code_context>
+ qCInfo(DDE_SHELL) << "Greeter login1 session active:" << active << "reactivated:" << reactivated;
+
+ if (reactivated && !m_model->userlistVisible() && getDconfigValue("loginPromptInput", false).toBool())
+ emit accountEntryActivated();
+ else
+ emit greeterActiveChanged(active);
</code_context>
<issue_to_address>
**Account form flashes before notice**
When an existing Greeter is reused in the reported X11 scenario and its frame is restored before the login1 activity-change handler runs, `accountEntryActivated` is emitted only after the login1 activity-change signal is delivered, so an X11 Greeter frame can be restored and show the existing account form before `LoginContent` starts the task and hides it; the user briefly sees the account-entry page before the notice.
Keep the account-entry content hidden until the reactivation handler has started the notice task, including across frame restoration.
</issue_to_address>e9c7d93 to
8198f70
Compare
1. Run the registered account entry task when reusing the Greeter or switching users from its password page. 2. Keep the login controls hidden while the task is pending and repaint the Greeter background before showing another account entry page. 3. Use login1 activity transitions to keep initial Greeter activation on the existing pre-greeter path. Log: Show the user notice before the account entry page. Influence: 1. Check initial login and login after logout with the notice enabled. 2. Check switching users from a locked desktop to an existing Greeter. 3. Check switching users from the password page with multiple displays. fix: 在显示 Greeter 账号输入页前运行用户须知 1. 复用 Greeter 或从 Greeter 密码页切换用户时运行已注册的任务。 2. 等待任务期间隐藏登录控件并重绘背景,结束后显示账号输入页。 3. 根据 login1 会话激活变化识别复用,新 Greeter 继续走 pre-greeter。 Influence: 1. 验证开机登录和注销后登录时的须知显示顺序。 2. 验证从桌面锁屏切回复用 Greeter 的流程。 3. 验证多屏下从 Greeter 密码页返回账号输入页的流程。 Log: 在账号输入页显示前展示用户须知。 PMS: BUG-384345
8198f70 to
4804128
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
3119238
into
linuxdeepin:release/2500u2-pajil
改动
在
userlist=false、loginPromptInput=true时,复用已有 Greeter 或从 Greeter 密码页点击「切换用户」,先运行账号输入前注册的任务。任务等待期间隐藏登录控件、重绘背景,任务结束后显示账号输入页。新建 Greeter 继续使用pre-greeter。验证
配套 PR 为 dde-session-ui #482。
PMS: BUG-384345
Summary by Sourcery
Gate account input behind configurable preparation tasks while keeping the Greeter UI hidden and synchronized until the flow is ready.
New Features:
Bug Fixes:
Enhancements:
Build: