Repository navigation
Conversation
When triggering "show desktop" while a dock popup is open, the popup was only closed passively via focus loss after treeland rearranged windows, causing a brief flash. The root cause is that treeland_show_desktop_v1_show_desktop_state() only updated internal state without emitting a signal, so the dock panel had no way to proactively close popups before the window rearrangement. Add showDesktopStateChanged signal to TreelandShowDesktop, forward it via ShowDesktop::desktopShownChanged, and listen for it in main.qml to call Panel.requestClosePopup() when the desktop is shown. Log: Fix popup flash when showing desktop with dock popup open Bug: https://pms.uniontech.com/bug-view-360895.html
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe change exposes Treeland’s show-desktop state as a signal and forwards it to QML, allowing the dock to close all popups immediately when showing the desktop and preventing a transient popup flash during window reordering. Sequence diagram for proactive popup closure when showing desktopsequenceDiagram
participant Treeland
participant TreelandShowDesktop
participant ShowDesktop
participant QML
participant Panel
Treeland->>TreelandShowDesktop: treeland_show_desktop_v1_show_desktop_state(state)
TreelandShowDesktop->>TreelandShowDesktop: update m_desktopState
TreelandShowDesktop-->>ShowDesktop: showDesktopStateChanged(true)
ShowDesktop-->>QML: desktopShownChanged(true)
QML->>Panel: requestClosePopup()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,信号链路设计合理,无需修改 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议为新增的信号添加简要文档注释,说明信号的触发条件和参数含义,提升代码可维护性 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,Qt 信号/槽机制在同线程下为直接调用,开销极小;状态变更守卫(state != m_desktopState)避免了冗余信号发射 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 无安全风险,代码不涉及用户输入处理、文件操作、网络操作、命令执行等安全敏感场景。Wayland 协议状态值来自受信任的合成器(compositor) 💡 改进建议代码示例// showdesktop.h - 建议添加注释
Q_SIGNALS:
void visibleChanged();
/// \brief 当桌面显示状态变化时发出此信号
/// \param shown true 表示桌面正在显示,false 表示取消显示桌面
void desktopShownChanged(bool shown);
// treelandshowdesktop.h - 建议添加注释
Q_SIGNALS:
/// \brief 当 Wayland 协议报告桌面状态变化时发出此信号
/// \param shown true 表示桌面正在显示,false 表示取消显示桌面
void showDesktopStateChanged(bool shown);本报告由 AI 代码审查工具自动生成 |
|
此pr为multica提交的,分析不合理,且此问题已经修复了。故关闭此pr |
修复:显示桌面时主动关闭任务栏插件面板(闪现问题)
问题
当桌面上有应用窗口置顶时,用户打开任务栏插件面板(popup)后触发"显示桌面"功能,popup 会闪现一次再消失。
根因
treeland_show_desktop_v1_show_desktop_state()回调仅更新内部状态m_desktopState,不 emit 任何信号,导致 dock 面板无法在 treeland 窗口重排前主动关闭 popup。popup 只能被动通过焦点丢失关闭,与 treeland 窗口重排存在时序窗口,产生闪现。修复方案
在
TreelandShowDesktop类中新增showDesktopStateChanged信号,通过ShowDesktop::desktopShownChanged转发,在main.qml中监听该信号并在显示桌面时主动调用Panel.requestClosePopup()关闭所有 popup。改动文件
panels/dock/showdesktop/treelandshowdesktop.h— 新增Q_SIGNALS,声明showDesktopStateChanged(bool shown)panels/dock/showdesktop/treelandshowdesktop.cpp— 状态变更后Q_EMIT showDesktopStateChanged(state == state_show)panels/dock/showdesktop/showdesktop.h— 新增desktopShownChanged(bool shown)信号panels/dock/showdesktop/showdesktop.cpp—init()中connect转发信号panels/dock/package/main.qml— 监听desktopShownChanged,主动关闭 popup安全评估
纯增量改动,不修改任何现有函数签名或调用路径,回归风险低。
PMS Bug: https://pms.uniontech.com/bug-view-360895.html
Summary by Sourcery
Prevent dock popup flicker by notifying the UI when the desktop is shown and closing active popups immediately.
Bug Fixes:
Enhancements: