Skip to content

refactor(launcher): remove redundant window flags configuration#725

Open
add-uos wants to merge 1 commit intolinuxdeepin:masterfrom
add-uos:fix/BUG-289261-BUG-343503-window-flags
Open

refactor(launcher): remove redundant window flags configuration#725
add-uos wants to merge 1 commit intolinuxdeepin:masterfrom
add-uos:fix/BUG-289261-BUG-343503-window-flags

Conversation

@add-uos
Copy link

@add-uos add-uos commented Mar 7, 2026

Remove commented visibility setting and conditional window flags that are no longer needed.

删除不再需要的窗口可见性注释和条件窗口标志配置。

Log: 移除冗余的窗口标志配置
PMS: BUG-289261, BUG-343503
Influence: 清理冗余代码,窗口标志现在由 DLayerShellWindow 统一管理。

Summary by Sourcery

Enhancements:

  • Simplify launcher window configuration by removing obsolete visibility and flag settings that are now managed by DLayerShellWindow.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

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

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 7, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the launcher item's window configuration by removing now-redundant window flags logic so that window behavior is fully managed by DLayerShellWindow/DWindow.

Class diagram for launcher window configuration refactor

classDiagram
    class AppletItem {
    }

    class LauncherItemWindow {
        <<QML_Window>>
        string note_removed_flags "Removed flags"
    }

    class DLayerShellWindow {
        <<QML_Attached_Properties>>
        int exclusionZone
        string scope
        string note_window_flags_visibility "Manages window flags and visibility"
    }

    class DWindow {
        <<QML_Attached_Properties>>
        bool enabled
        int windowRadius
        bool enableSystemResize
    }

    class DebugHelper {
        <<Singleton>>
        bool useRegularWindow
    }

    AppletItem *-- LauncherItemWindow : contains
    LauncherItemWindow .. DLayerShellWindow : attached
    LauncherItemWindow .. DWindow : attached
    DebugHelper ..> DWindow : controls enabled
Loading

Flow diagram for launcher window configuration after refactor

flowchart LR
    A[LauncherItemWindow creation] --> B[DLayerShellWindow attached properties]
    A --> C[DWindow attached properties]

    B --> B1[exclusionZone = -1]
    B --> B2[scope = dde-shell/launchpad]

    C --> D{DebugHelper.useRegularWindow}
    D -- true --> E[DWindow.enabled = false]
    D -- false --> F[DWindow.enabled = true]

    B1 --> G[Window behavior managed by DLayerShellWindow]
    B2 --> G
    E --> G
    F --> G
Loading

File-Level Changes

Change Details Files
Remove custom window flags configuration from the launcher item so window behavior is fully controlled by the underlying shell/window abstractions.
  • Deleted the commented-out visibility property that forced fullscreen mode.
  • Removed the flags function block that conditionally chose between a regular Qt.Window and a frameless Qt.Tool window based on DebugHelper.useRegularWindow.
  • Left DWindow- and DLayerShellWindow-related properties intact so window configuration is now centralized there.
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

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 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.

@add-uos add-uos force-pushed the fix/BUG-289261-BUG-343503-window-flags branch from ab034c1 to f954f5e Compare March 7, 2026 02:50
BLumia
BLumia previously approved these changes Mar 7, 2026
Copy link
Member

@BLumia BLumia left a comment

Choose a reason for hiding this comment

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

能接受,DebugHelper 的独立窗口模式目前已经没人用了大概,不过如果能保留这个选项的功能的话更好,这个选项是用来给特定调试需求 attach gammaray 用的。

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.

@add-uos add-uos force-pushed the fix/BUG-289261-BUG-343503-window-flags branch from f954f5e to eff1b05 Compare March 7, 2026 06:13
Remove commented visibility setting and conditional window flags
that are no longer needed.

删除不再需要的窗口可见性注释和条件窗口标志配置。

Log: 移除冗余的窗口标志配置
PMS: BUG-289261, BUG-343503
Influence: 清理冗余代码,窗口标志现在由 DLayerShellWindow 统一管理。
@add-uos add-uos force-pushed the fix/BUG-289261-BUG-343503-window-flags branch from eff1b05 to 4e4a993 Compare March 9, 2026 09:33
@deepin-ci-robot
Copy link

deepin pr auto review

这段代码是一个 QML 文件(launcheritem.qml)的差异对比,主要涉及版权年份更新和部分窗口属性代码的删除。以下是对这段 diff 的审查意见,包括语法逻辑、代码质量、代码性能和代码安全方面的分析:

1. 语法逻辑

  • 版权年份更新SPDX-FileCopyrightText2023 更新为 2023 - 2026。这是合法的,通常用于表明项目维护的预期时间范围。
  • 删除的代码
    • 删除了 visibility: Window.FullScreen 的注释行,这是合理的,因为注释掉的代码通常应该被移除以保持代码整洁。
    • 删除了 flags 属性的定义,该属性根据 DebugHelper.useRegularWindow 的值动态返回窗口标志。删除这段代码可能意味着窗口标志现在由其他机制(如 DWindowDLayerShellWindow)控制,或者不再需要动态切换。

2. 代码质量

  • 代码整洁性:删除注释掉的代码和不再使用的 flags 定义有助于提高代码的可读性和维护性。
  • 一致性:删除 flags 定义后,窗口标志的控制逻辑应统一由 DWindowDLayerShellWindow 管理,避免多处定义导致混淆。

3. 代码性能

  • 性能影响:删除 flags 的动态计算可能会略微减少运行时的属性绑定计算,但影响微乎其微,可以忽略不计。

4. 代码安全

  • 潜在问题:删除 flags 定义后,窗口标志的控制逻辑完全依赖于 DWindowDLayerShellWindow。如果这些组件的行为发生变化,可能会导致窗口显示异常(如无法全屏或无法无边框显示)。
  • 建议
    • 确保 DWindowDLayerShellWindow 的实现能够正确处理窗口标志,尤其是在调试模式和非调试模式下的行为一致性。
    • 如果 flags 的删除是为了简化代码,建议在文档或注释中说明窗口标志的控制逻辑已迁移至其他组件。

5. 改进建议

  • 文档化变更:如果 flags 的删除是重大变更,建议在提交信息或相关文档中说明原因和影响范围。
  • 测试覆盖:确保在调试模式和非调试模式下,窗口的显示行为(如全屏、无边框等)仍然符合预期。

总结

这段 diff 主要是代码清理工作,删除了不再使用的 flags 定义和注释代码,同时更新了版权年份。整体上是积极的改进,但需要确保窗口标志的控制逻辑在其他组件中正确实现,并通过测试验证窗口行为的一致性。

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