Skip to content

fix(notification): change bubble window layer from LayerTop to LayerOverlay#1497

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
add-uos:fix/BUG-343503
Mar 12, 2026
Merged

fix(notification): change bubble window layer from LayerTop to LayerOverlay#1497
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
add-uos:fix/BUG-343503

Conversation

@add-uos
Copy link
Contributor

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

Fix notification bubble window layer to ensure proper display on top of other windows.

修复通知气泡窗口的层级设置,确保正确显示在其他窗口之上。

Log: 修复通知气泡窗口层级显示问题
PMS: BUG-289261, BUG-343503
Influence: 通知气泡现在使用 Overlay 层级,能够正确显示在所有其他窗口之上,修复了在某些情况下通知气泡被遮挡的问题。

Summary by Sourcery

Bug Fixes:

  • Fix notification bubble z-order so it is no longer obscured by other windows in certain cases.

…verlay

Fix notification bubble window layer to ensure proper display on top of
other windows.

修复通知气泡窗口的层级设置,确保正确显示在其他窗口之上。

Log: 修复通知气泡窗口层级显示问题
PMS: BUG-289261, BUG-343503
Influence: 通知气泡现在使用 Overlay 层级,能够正确显示在所有其他窗口之上,修复了在某些情况下通知气泡被遮挡的问题。
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 12, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Switches the notification bubble window from using the generic top layer to the overlay layer so that it always appears above other windows.

Flow diagram for notification bubble layer selection

flowchart TD
  A[NotificationBubbleWindow created in main_qml] --> B[Set visible from Applet_visible]
  B --> C[Configure DLayerShellWindow_anchors
Bottom and Right]
  C --> D[Set DLayerShellWindow_topMargin and rightMargin]
  D --> E[Set DLayerShellWindow_layer to LayerOverlay]

  subgraph Before_change
    E0[Set DLayerShellWindow_layer to LayerTop]
  end

  subgraph After_change
    E[Set DLayerShellWindow_layer to LayerOverlay]
  end

  E0 -.replaced_by.-> E
Loading

File-Level Changes

Change Details Files
Update notification bubble window stacking layer to use the overlay layer for proper z-ordering.
  • Change the DLayerShellWindow.layer property from LayerTop to LayerOverlay for the notification bubble Window
  • Keep all other window sizing, visibility, and anchoring properties unchanged to preserve existing layout and behavior
panels/notification/bubble/package/main.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.

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码修改涉及到了窗口层级(Layer)的变更,主要是在 Wayland 合成器(如 KWin)下对窗口显示层级的管理。

以下是对该修改的详细审查意见,涵盖语法逻辑、代码质量、性能和安全四个方面:

1. 语法逻辑

  • 修改内容:将 DLayerShellWindow.layerLayerTop 修改为 LayerOverlay
  • 分析
    • 在 Wayland Layer Shell 协议中,LayerOverlay 的层级高于 LayerTop
    • LayerOverlay 通常用于需要覆盖在所有内容之上的元素(如屏幕键盘、锁屏界面、或者紧急通知)。
    • LayerTop 通常用于常规的顶层窗口(如面板、常规通知)。
  • 结论:语法上没有问题。逻辑上,这意味着开发者希望该通知气泡具有比普通顶层窗口更高的优先级,确保它始终显示在其他常规应用或面板之上。

2. 代码质量

  • 可维护性:直接硬编码层级属性是 QML 中常见的做法,但在修改层级时需要非常小心。
  • 潜在风险:将通知气泡设置为 LayerOverlay 可能会导致它遮挡住同样处于 LayerOverlay 层级的关键系统 UI(例如:锁屏界面、系统关机对话框、屏幕键盘)。
  • 建议
    • 需要确认该通知气泡是否真的需要覆盖在锁屏界面之上。如果不需要,使用 LayerTop 可能是更合适的选择,以免干扰系统关键流程。
    • 如果确实需要覆盖锁屏,建议检查与锁屏模块的交互逻辑,确保在锁屏状态下通知气泡的显示行为符合预期(例如是否应该自动折叠或隐藏)。

3. 代码性能

  • 影响:窗口层级的变更主要影响合成器的渲染顺序和输入事件的分发顺序,对 CPU/GPU 的渲染性能影响微乎其微。
  • 结论:此修改对性能无负面影响。

4. 代码安全

  • 安全性:此修改本身不涉及内存安全漏洞或数据泄露风险。
  • 输入安全:由于 LayerOverlay 窗口通常位于最顶层,它会优先接收鼠标/触摸输入事件。
    • 潜在问题:如果该通知气泡由于逻辑错误未能正确隐藏,或者其透明区域未正确处理点击穿透,它可能会“劫持”用户的输入事件,导致用户无法点击到位于其下方的锁屏界面或其他关键按钮。
  • 建议:务必确保当窗口不可见(visible: false)时,它确实从 Wayland 层中移除或不再接收输入。

总结与改进建议

总体评价
代码修改语法正确,能够实现将通知气泡提升至最高层级的意图。但在用户体验和系统交互层面存在潜在风险。

改进建议

  1. 确认层级必要性:请再次确认业务需求。如果仅仅是为了让通知浮在普通应用窗口之上,LayerTop 通常已经足够。除非该通知是极度紧急的系统级警报,否则不建议随意使用 LayerOverlay,以免遮挡锁屏或全屏应用(如游戏、视频)。
  2. 处理遮挡问题:如果必须使用 LayerOverlay,建议添加逻辑判断,在检测到锁屏界面激活时,降低该窗口的层级或暂时隐藏它,防止遮挡系统安全界面。
  3. 输入穿透检查:确认 QML 组件的 acceptedButtons 和鼠标区域处理逻辑,确保在窗口不需要交互时,点击事件能正确穿透到底层窗口。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@add-uos
Copy link
Contributor Author

add-uos commented Mar 12, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Mar 12, 2026

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit 6e6d979 into linuxdeepin:master Mar 12, 2026
11 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.

3 participants