fix: fix wallpaper-only display after lid reopen#1015
Conversation
Reviewer's GuideEnsures outputs fully restore mode/scale and repaint after lid reopen or resume, and keeps lockscreen surfaces/components in sync when outputs are re‑enabled to fix the wallpaper‑only display issue. Sequence diagram for output re-enable via onSetOutputPowerMode MODE_ONsequenceDiagram
participant PowerManager as wlr_output_power_v1
participant Helper as Helper
participant WlrOutput as wlr_output
participant WOutputObj as WOutput
PowerManager->>Helper: onSetOutputPowerMode(event)
Helper->>WlrOutput: enabled?
alt output_disabled
Helper->>WlrOutput: preferred_mode()
Helper->>WlrOutput: commit_state(newState with mode, scale, enabled=true)
alt commit_success
Helper->>WlrOutput: schedule_frame()
else commit_failed
Helper-->>PowerManager: log commit failed
end
else output_already_enabled
Helper-->>PowerManager: return
end
Sequence diagram for resume handling in Helper::onPrepareForSleep(false)sequenceDiagram
participant System as SystemPower
participant Helper as Helper
participant OutputWrapper as OutputWrapper
participant WOutputObj as WOutput
participant RenderWindow as RenderWindow
System->>Helper: onPrepareForSleep(false)
Helper->>Helper: enableRender()
loop for each o in m_outputList
Helper->>OutputWrapper: output()
alt output_enabled
Helper->>WOutputObj: scheduleFrame()
end
end
Helper->>RenderWindow: update()
Sequence diagram for LockScreen reacting to WOutput::enabledChangedsequenceDiagram
participant WOutputObj as WOutput
participant LockScreen as LockScreen
participant OutputWrapper as Output
participant LockSurface as ext_session_lock_v1_surface
participant Component as LockComponent
participant Window as RenderWindow
WOutputObj->>LockScreen: enabledChanged()
alt output_enabled_and_locked
LockScreen->>OutputWrapper: outputItem()
alt outputItem_exists
LockScreen->>LockSurface: configureSize(outputItem->size())
end
LockScreen->>Component: setSize(outputItem->size())
LockScreen->>Window: update()
else not_enabled_or_not_locked
LockScreen-->>WOutputObj: return
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Restore current mode and scale in onSetOutputPowerMode MODE_ON branch, and call schedule_frame after commit 2. Iterate outputs to call scheduleFrame and trigger m_renderWindow->update() in onPrepareForSleep(false) 3. Connect WOutput::enabledChanged in LockScreen::addOutput to reconfigure lock surface and update DDM lockscreen component size when output re-enables Log: Fixed the issue where only wallpaper is displayed after reopening the laptop lid Influence: 1. Test laptop lid close and reopen, verify full desktop restores 2. Test with lock screen enabled, verify lock screen renders correctly after reopen 3. Test DPMS off/on cycle, verify output mode and scale are restored 4. Test suspend/resume cycle, verify rendering pipeline fully recovers fix: 修复合盖后重开只显示壁纸的问题 1. 在 onSetOutputPowerMode 的 MODE_ON 分支恢复 current mode 和 scale,commit 成功后调用 schedule_frame 2. 在 onPrepareForSleep(false) 中遍历 outputs 调用 scheduleFrame,并触发 m_renderWindow->update() 3. 在 LockScreen::addOutput 中连接 WOutput::enabledChanged 信号,当 output 重新启用时重新配置 lock surface 和 更新 DDM 锁屏组件尺寸 Log: 修复合盖后重开只显示壁纸的问题 Influence: 1. 测试笔记本合盖后重开,验证完整桌面恢复 2. 测试锁屏状态下合盖重开,验证锁屏正确渲染 3. 测试 DPMS 关闭/开启循环,验证输出模式和缩放恢复 4. 测试休眠/唤醒循环,验证渲染管线完整恢复
238cc2d to
7fa1c77
Compare
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm 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 |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm 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 |
Summary
Fix the issue where only wallpaper is displayed after reopening the laptop lid.
Changes
schedule_frame()after successful commit to trigger render pipeline recovery.scheduleFrame()and triggerm_renderWindow->update()for full repaint after resume.WOutput::enabledChangedsignal to reconfigure ext_session_lock_v1 lock surface size and update DDM lockscreen component size when output re-enables.Root Cause
When the laptop lid is closed and reopened, the render pipeline is not fully restored:
onSetOutputPowerModeonly setsenabled=truewithout restoring mode/scale or triggering frame schedulingonPrepareForSleep(false)only callsenableRender()without scheduling frames or triggering repaintFixes: #WM-37
Summary by Sourcery
Ensure display and lockscreen state are fully restored after outputs are re-enabled from power events such as lid reopen or resume from sleep.
Bug Fixes: