Skip to content

feat: set window title for launcher popup#742

Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master
Mar 19, 2026
Merged

feat: set window title for launcher popup#742
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Mar 19, 2026

  1. Added windowTitle property to launcher popup window to help KWin
    distinguish it from other popup windows
  2. Updated debian/control to add dde-shell dependency (version > 2.0.33)
    to ensure compatibility with the window title feature

Log: Set window title for launcher popup to improve window management

Influence:

  1. Test launcher popup opening and closing functionality
  2. Verify window title appears correctly in window manager
  3. Check that launcher can be distinguished from other popup windows
    in KWin
  4. Test compatibility with different DDE shell versions
  5. Verify launcher positioning and behavior remains unchanged

feat: 为启动器弹窗设置窗口标题

  1. 为启动器弹窗窗口添加 windowTitle 属性,帮助 KWin 区分其他弹窗窗口
  2. 更新 debian/control 添加 dde-shell 依赖(版本 > 2.0.33)以确保窗口标
    题功能的兼容性

Log: 为启动器弹窗设置窗口标题以改进窗口管理

Influence:

  1. 测试启动器弹窗的打开和关闭功能
  2. 验证窗口标题在窗口管理器中正确显示
  3. 检查启动器在 KWin 中是否能与其他弹窗窗口区分开来
  4. 测试与不同 DDE shell 版本的兼容性
  5. 验证启动器定位和行为保持不变

Summary by Sourcery

Set a distinct window title for the launcher popup and bump the dde-shell dependency to ensure compatibility with this behavior.

New Features:

  • Assign a specific window title to the launcher popup window to allow window managers to distinguish it from other popups.

Build:

  • Update Debian control metadata to require dde-shell version greater than 2.0.33 for window title support.

1. Added windowTitle property to launcher popup window to help KWin
distinguish it from other popup windows
2. Updated debian/control to add dde-shell dependency (version > 2.0.33)
to ensure compatibility with the window title feature

Log: Set window title for launcher popup to improve window management

Influence:
1. Test launcher popup opening and closing functionality
2. Verify window title appears correctly in window manager
3. Check that launcher can be distinguished from other popup windows
in KWin
4. Test compatibility with different DDE shell versions
5. Verify launcher positioning and behavior remains unchanged

feat: 为启动器弹窗设置窗口标题

1. 为启动器弹窗窗口添加 windowTitle 属性,帮助 KWin 区分其他弹窗窗口
2. 更新 debian/control 添加 dde-shell 依赖(版本 > 2.0.33)以确保窗口标
题功能的兼容性

Log: 为启动器弹窗设置窗口标题以改进窗口管理

Influence:
1. 测试启动器弹窗的打开和关闭功能
2. 验证窗口标题在窗口管理器中正确显示
3. 检查启动器在 KWin 中是否能与其他弹窗窗口区分开来
4. 测试与不同 DDE shell 版本的兼容性
5. 验证启动器定位和行为保持不变
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 19, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Sets an explicit window title on the launcher popup QML window so KWin and other window managers can distinguish it from other popups, and updates Debian packaging to require a dde-shell version that supports this behavior.

Sequence diagram for launcher popup showing with explicit windowTitle

sequenceDiagram
    actor User
    participant LauncherApplet
    participant LauncherPopupWindow
    participant WindowManager_KWin

    User->>LauncherApplet: triggerLauncher()
    LauncherApplet->>LauncherPopupWindow: openPopup()
    LauncherPopupWindow->>LauncherPopupWindow: set windowTitle dde-shell/launchpad
    LauncherPopupWindow->>WindowManager_KWin: createWindow(windowTitle)
    WindowManager_KWin->>WindowManager_KWin: classifyWindowByTitle()
    WindowManager_KWin-->>User: display popup as launcher window
    User->>LauncherApplet: closeLauncher()
    LauncherApplet->>LauncherPopupWindow: closePopup()
    LauncherPopupWindow->>WindowManager_KWin: destroyWindow()
Loading

Class diagram for launcher popup QML window with windowTitle property

classDiagram
    class LauncherItem {
        int width
        int height
        // other existing properties
    }

    class LauncherPopupWindow {
        int width
        int height
        string windowTitle
        int popupX
        int popupY
    }

    LauncherItem "1" *-- "1" LauncherPopupWindow : contains

    class DockPanelPositioner {
        int x
        int y
        rect bounding
    }

    LauncherPopupWindow --> DockPanelPositioner : positions popup

    class Panel {
        static int position
    }

    Panel <.. DockPanelPositioner : provides position context
Loading

File-Level Changes

Change Details Files
Assign a fixed window title to the launcher popup window to improve window manager identification and behavior.
  • Set the QML Window's windowTitle property to a constant value identifying the launcher popup
  • Kept popup dimensions and positioning logic unchanged to avoid behavioral regressions
shell-launcher-applet/package/launcheritem.qml
Tighten Debian packaging requirements to ensure the window title feature is supported at runtime.
  • Increase dde-shell minimum required version to > 2.0.33 in Debian control metadata to match the new window title behavior
debian/control

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider defining the window title string ("dde-shell/launchpad") as a shared constant or central configuration so it can be reused consistently by other components or future popups that need to be distinguished by KWin.
  • If the debian/control change uses a strict "> 2.0.33" version constraint as described, you may want to switch to ">= 2.0.33" to avoid unnecessarily excluding builds that exactly match 2.0.33 while still guaranteeing compatibility.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider defining the window title string ("dde-shell/launchpad") as a shared constant or central configuration so it can be reused consistently by other components or future popups that need to be distinguished by KWin.
- If the debian/control change uses a strict "> 2.0.33" version constraint as described, you may want to switch to ">= 2.0.33" to avoid unnecessarily excluding builds that exactly match 2.0.33 while still guaranteeing compatibility.

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.

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码的 diff 包含了两个文件的修改:debian/control(包依赖配置)和 shell-launcher-applet/package/launcheritem.qml(QML 界面代码)。以下是对这两处修改的详细审查和改进意见:

1. 文件:debian/control

修改内容:
增加了一个依赖项 dde-shell(>> 2.0.33)

审查意见:

  • 语法逻辑:语法正确。在 Debian 控制文件中,>> 表示严格大于版本 2.0.33。这是标准的版本约束语法。
  • 代码质量
    • 版本号一致性:需要确认 2.0.33 是否是当前发布或测试环境中 dde-shell 的确切版本。如果是为了引入某个特定功能(如下文 QML 中可能用到的属性),这个版本号必须准确对应引入该功能的版本。
    • 依赖关系dde-shell 作为一个核心组件,被应用启动器依赖是合理的。
  • 代码性能:不适用(配置文件)。
  • 代码安全
    • 依赖安全:引入新的依赖意味着增加了供应链风险。建议确认 dde-shell 的来源可信,且该版本 2.0.33 修复了已知的安全漏洞。

2. 文件:shell-launcher-applet/package/launcheritem.qml

修改内容:
在定义窗口属性时,增加了一行 windowTitle: "dde-shell/launchpad"

审查意见:

  • 语法逻辑:语法正确。这是标准的 QML 属性赋值。
  • 代码质量
    • 硬编码字符串"dde-shell/launchpad" 是一个硬编码的字符串。
      • 改进建议:为了便于国际化和维护,建议使用 qsTr() 包裹字符串,例如:windowTitle: qsTr("dde-shell/launchpad")。虽然窗口标题通常不需要翻译,但如果未来需要根据系统语言显示不同的调试信息或标题,使用 qsTr 是更好的实践。
    • 命名规范windowTitle 是一个具有描述性的属性名,符合 QML 命名规范。
  • 代码性能
    • 性能影响: negligible(可忽略不计)。这仅仅是在窗口对象初始化时设置一个字符串属性,不会造成性能开销。
  • 代码安全
    • 信息泄露windowTitle 通常是用户可见的。如果 dde-shell/launchpad 是一个内部调试路径或组件名称,直接展示给最终用户可能显得不够专业或暴露内部架构。
      • 改进建议:如果这是面向用户的窗口,建议使用更友好的名称,例如“启动器”或“Launcher”。如果这是用于开发者调试窗口(如 qtdiagxwininfo 抓取窗口信息时识别),则当前写法是可以接受的,但建议加上注释说明其用途。
      • 示例代码
        // 设置窗口标题以便于调试和窗口管理器识别
        windowTitle: "dde-shell/launchpad"

综合改进建议总结

  1. 依赖检查:确认 dde-shell 2.0.33 是支持后续代码功能的最小版本,避免版本号过低导致运行时崩溃或功能缺失。
  2. 字符串处理:在 QML 中,虽然当前修改不影响功能,但建议养成使用 qsTr() 的习惯,除非该字符串明确不需要翻译且仅为内部标识。
  3. 注释补充:建议在 launcheritem.qml 的修改处添加简短注释,说明设置 windowTitle 的目的(例如:为了配合窗口管理器规则或便于调试),以便后续维护者理解意图。

修改后的代码片段建议:

// debian/control
Depends:
 ...
 dde-shell (>> 2.0.33),  // 引入新版本以支持特定功能
 ...
// shell-launcher-applet/package/launcheritem.qml
...
// 设置窗口标题,便于窗口管理器识别和调试
windowTitle: "dde-shell/launchpad" 
...

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

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

@18202781743 18202781743 merged commit d6ea6cf into linuxdeepin:master Mar 19, 2026
11 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.

3 participants