Conversation
…plug Use QPointer<QQuickItem> for m_loginView so it is automatically nulled when QML destroys the item, preventing dangling pointer access after TTY switches that disable and re-enable DRM outputs. Connect WOutput::enabledChanged in addOutput() to rebuild or reposition the login view when an output is re-enabled, and call repositionLoginView() so newly added outputs can be followed. Add rebuild logic in onCursorPositionChanged() and the new onOutputEnabledChanged() to recreate the login view when it has been destroyed by QML but the lock screen is still visible. 将 m_loginView 从裸指针改为 QPointer<QQuickItem>,QML 销毁后 自动置 null,避免 TTY 切换导致 DRM 输出禁用/启用时产生悬空指针。 addOutput 中连接 enabledChanged 信号并调用 repositionLoginView, 使热插拔副屏后登录界面可跟随鼠标。onCursorPositionChanged 和新增 的 onOutputEnabledChanged 在 m_loginView 为空且界面可见时重建。 Log: 修复TTY切回后登录界面消失及副屏热插拔后不跟随鼠标 Issue: Fixes WM-465 Influence: TTY切换回来后登录界面不再消失,副屏热插拔后登录/电源 界面正常跟随鼠标显示在对应屏幕上。
Reviewer's GuideFixes lock-screen login view loss after TTY switching by making its pointer resilient to QML destruction and adding recovery logic, while updating output lifecycle handling so login and power views are repositioned or recreated after display hotplug and re-enablement. Sequence diagram for lock-screen recovery after output re-enablementsequenceDiagram
participant WOutput
participant LockScreen
participant QML
WOutput->>LockScreen: onOutputEnabledChanged()
alt output disabled
LockScreen-->>WOutput: return
else output enabled and login view missing
LockScreen->>LockScreen: isVisible()
LockScreen->>QML: createLoginView()
else output enabled and login view exists
LockScreen->>LockScreen: repositionLoginView()
end
Sequence diagram for login view recovery after cursor movementsequenceDiagram
participant Cursor
participant LockScreen
participant QML
Cursor->>LockScreen: onCursorPositionChanged()
alt login view missing and lock screen visible
LockScreen->>QML: createLoginView()
else login view exists
LockScreen->>LockScreen: repositionLoginView()
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复:TTY 切回后登录界面消失 & 副屏拔插后登录/电源界面不跟随鼠标
问题
根因
m_loginView,但裸指针QQuickItem* m_loginView变成悬空指针。addOutput()未连接WOutput::enabledChanged信号,且未在输出添加后调用repositionLoginView(),导致热插拔副屏后登录/电源界面不会跟随鼠标。改动
m_loginView从QQuickItem*改为QPointer<QQuickItem>,QML 销毁后自动置 nulladdOutput()连接WOutput::enabledChanged→onOutputEnabledChanged(使用Qt::UniqueConnection),末尾调用repositionLoginView()removeOutput()断开enabledChanged连接onOutputEnabledChanged():检查isEnabled()后,若m_loginView为空且可见则重建,否则重新定位onCursorPositionChanged():m_loginView为空且可见时触发createLoginView()重建Multica Issue
WM-465
Summary by Sourcery
Restore lock-screen login and power interface visibility and mouse-following behavior after TTY switches and display hotplug events.
Bug Fixes:
Enhancements: