Skip to content

fix(launcher): remove Qt.Tool flag to fix window stacking#780

Merged
justforlxz merged 1 commit into
linuxdeepin:masterfrom
justforlxz:master
Jul 1, 2026
Merged

fix(launcher): remove Qt.Tool flag to fix window stacking#780
justforlxz merged 1 commit into
linuxdeepin:masterfrom
justforlxz:master

Conversation

@justforlxz

@justforlxz justforlxz commented Jul 1, 2026

Copy link
Copy Markdown
Member

Remove Qt.Tool from window flags to prevent QPA from setting
root window as transient parent, which causes stacking order
conflicts with dock popup.

移除 Qt.Tool 标志,避免与 dock popup 窗口排序冲突。

Log: 移除Qt.Tool标志修复窗口排序问题
PMS: BUG-364071
Influence: 移除后launcher窗口不再与dock popup属于同一group,排序恢复正常。

Summary by Sourcery

Bug Fixes:

  • Fix launcher window stacking order conflicts with dock popup windows by removing the Qt.Tool window flag.

Remove Qt.Tool from window flags to prevent QPA from setting
root window as transient parent, which causes stacking order
conflicts with dock popup.

移除 Qt.Tool 标志,避免与 dock popup 窗口排序冲突。

Log: 移除Qt.Tool标志修复窗口排序问题
PMS: BUG-364071
Influence: 移除后launcher窗口不再与dock popup属于同一group,排序恢复正常。
@sourcery-ai

sourcery-ai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the launcher applet window flags to remove Qt.Tool, preventing QPA from treating it as a transient tool window and resolving stacking order conflicts with the dock popup.

Sequence diagram for launcher window flags affecting dock popup stacking

sequenceDiagram
    participant LauncherItem
    participant QPA
    participant DockPopup

    alt [before: Qt.Tool included]
        LauncherItem->>QPA: setWindowFlags(Qt.FramelessWindowHint | Qt.Tool)
        QPA->>LauncherItem: setTransientParent(DockPopup)
        LauncherItem->>DockPopup: [shares stacking group]
    else [after: Qt.Tool removed]
        LauncherItem->>QPA: setWindowFlags(Qt.FramelessWindowHint)
        QPA-->>LauncherItem: [no transient parent set]
        LauncherItem-->>DockPopup: [separate stacking group]
    end
Loading

File-Level Changes

Change Details Files
Change launcher window flags so the launcher is a frameless normal window instead of a Qt.Tool window, fixing stacking/parenting issues with dock popups.
  • Update window flags expression to return only Qt.FramelessWindowHint when not using the regular window debug mode
  • Preserve existing DebugHelper.useRegularWindow path that still uses Qt.Window flags
  • Keep DWindow.enabled logic tied to DebugHelper.useRegularWindow unchanged
shell-launcher-applet/package/launcheritem.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@justforlxz justforlxz requested a review from BLumia July 1, 2026 06:36
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:65分

■ 【总体评价】

代码修改了QML窗口标志位,但移除Qt.Tool标志导致严重的窗口行为异常
逻辑存在严重错误且缺乏修改依据,扣除相应分数

■ 【详细分析】

  • 1.语法逻辑(存在严重错误)✕

在launcheritem.qml文件的flags属性绑定中,将Qt.FramelessWindowHint | Qt.Tool修改为仅保留Qt.FramelessWindowHint。从QML语法上看赋值合法,但从业务逻辑上看,移除Qt.Tool标志直接导致弹出窗口无法正确嵌入面板、任务栏显示异常或失去焦点处理失效,属于核心逻辑错误。
潜在问题:窗口层级和焦点策略改变导致启动器项弹出窗口无法正常工作
建议:恢复Qt.Tool标志位的设置,确保弹出窗口保持工具窗口的正确行为

  • 2.代码质量(存在严重问题)✕

修改了关键的窗口标志位组合,但未添加任何注释说明移除Qt.Tool的原因和目的。这种破坏性修改缺乏必要的代码审查依据和上下文说明,降低了代码的可维护性。
潜在问题:无注释的破坏性修改容易导致后续维护者误解代码意图
建议:在修改处增加详细注释说明为何要移除该标志,或者如果这是一个错误提交则直接回退

  • 3.代码性能(无性能问题)✓

修改窗口标志位仅在窗口创建或属性更新时生效,不涉及频繁计算或资源消耗,对运行时性能无影响。
建议:保持当前的属性绑定方式即可

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
该修改仅涉及UI窗口类型的标志位调整,不涉及命令注入、越权访问、敏感信息泄露等安全攻击面。

  • 建议:无需进行安全修复,重点应放在修复业务逻辑错误上

■ 【改进建议代码示例】

        flags: {
            if (DebugHelper.useRegularWindow) return Qt.Window
            // 保持 Qt.Tool 标志以确保窗口作为工具窗口运行,
            // 避免在任务栏显示并正确处理焦点丢失事件
            return (Qt.FramelessWindowHint | Qt.Tool)
        }

        DWindow.enabled: !DebugHelper.useRegularWindow

@deepin-ci-robot

Copy link
Copy Markdown

@justforlxz: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
github-pr-review-ci bb85fad link true /test github-pr-review-ci

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@justforlxz justforlxz changed the title yes fix(launcher): remove Qt.Tool flag to fix window stacking Jul 1, 2026

@BLumia BLumia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

窗管:若产生启动器实际不会被置顶的关联影响,则窗管配合做调整

@justforlxz

Copy link
Copy Markdown
Member Author

https://github.com/KDE/kwin-x11/blob/5c317b227e744b045c2855d12b139209c35d9bcd/src/x11window.cpp#L3343

该函数会在计算同组的 transient parent时,将launchpad提升到同组最高

  launchpad transient-for root (997)
    → verifyTransientFor → XCB_WINDOW_NONE
    → setTransient(XCB_WINDOW_NONE)
      → removeFromMainClients()     // 从 dock 移除 transient
      → checkGroup(nullptr, true)
        → groupTransient=true → re-binding loop
          → addTransient(dock, launchpad)    → shouldKeepTransientAbove=false → SKIP ✓
          → addTransient(panelpopup, launchpad) → shouldKeepTransientAbove=true  → [Constraint] ADD ✗

@justforlxz

Copy link
Copy Markdown
Member Author

deepin pr auto review

★ 总体评分:65分

■ 【总体评价】

代码修改了QML窗口标志位,但移除Qt.Tool标志导致严重的窗口行为异常
逻辑存在严重错误且缺乏修改依据,扣除相应分数

■ 【详细分析】

  • 1.语法逻辑(存在严重错误)✕

在launcheritem.qml文件的flags属性绑定中,将Qt.FramelessWindowHint | Qt.Tool修改为仅保留Qt.FramelessWindowHint。从QML语法上看赋值合法,但从业务逻辑上看,移除Qt.Tool标志直接导致弹出窗口无法正确嵌入面板、任务栏显示异常或失去焦点处理失效,属于核心逻辑错误。
潜在问题:窗口层级和焦点策略改变导致启动器项弹出窗口无法正常工作
建议:恢复Qt.Tool标志位的设置,确保弹出窗口保持工具窗口的正确行为

  • 2.代码质量(存在严重问题)✕

修改了关键的窗口标志位组合,但未添加任何注释说明移除Qt.Tool的原因和目的。这种破坏性修改缺乏必要的代码审查依据和上下文说明,降低了代码的可维护性。
潜在问题:无注释的破坏性修改容易导致后续维护者误解代码意图
建议:在修改处增加详细注释说明为何要移除该标志,或者如果这是一个错误提交则直接回退

  • 3.代码性能(无性能问题)✓

修改窗口标志位仅在窗口创建或属性更新时生效,不涉及频繁计算或资源消耗,对运行时性能无影响。
建议:保持当前的属性绑定方式即可

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
该修改仅涉及UI窗口类型的标志位调整,不涉及命令注入、越权访问、敏感信息泄露等安全攻击面。

  • 建议:无需进行安全修复,重点应放在修复业务逻辑错误上

■ 【改进建议代码示例】

        flags: {
            if (DebugHelper.useRegularWindow) return Qt.Window
            // 保持 Qt.Tool 标志以确保窗口作为工具窗口运行,
            // 避免在任务栏显示并正确处理焦点丢失事件
            return (Qt.FramelessWindowHint | Qt.Tool)
        }

        DWindow.enabled: !DebugHelper.useRegularWindow

移除 Qt::Tool 有两个原因:

  1. launchpad的置顶显示应当由合成器辅助完成
  2. launchpad设置的transientParent: null和Qt的行为有冲突

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, justforlxz, zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@justforlxz justforlxz merged commit b30a72b into linuxdeepin:master Jul 1, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants