Skip to content

fix(dock): raise dock to LayerOverlay on Wayland - #1697

Closed
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix/dock-overlay-wayland
Closed

fix(dock): raise dock to LayerOverlay on Wayland#1697
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix/dock-overlay-wayland

Conversation

@wjyrich

@wjyrich wjyrich commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

背景

点击任务栏插件区图标(网络/音量等)弹出面板时,通知横幅(bubble)层级显示在面板上层,应展示在下层。

根因

  • dock 面板:panels/dock/package/main.qmlDLayerShellWindow.layer: LayerTop
  • 通知横幅(bubble):panels/notification/bubble/package/main.qmlDLayerShellWindow.layer: LayerOverlay
  • dock 弹窗(网络/音量等)作为 xdg_popup 经 zwlr_layer_surface_v1.get_popup() 挂到 dock 的 layer surface 上,继承 dock 的 LayerTop
  • 按 wlr-layer-shell 协议层序 Background < Bottom < [normal] < Top < Overlay,Overlay 高于 Top,故 bubble(Overlay) 渲染在 dock 弹窗(继承 Top)之上 → 复现本 bug

修复方案

Wayland 下将 dock 升至 LayerOverlay,弹窗继承 Overlay 后同层「后映射者在上方」压过 bubble:

DLayerShellWindow.layer: Qt.platform.pluginName === "wayland" ? DLayerShellWindow.LayerOverlay : DLayerShellWindow.LayerTop

X11 维持 LayerTop——x11dlayershellemulation.cpp:110 会将 LayerOverlay 映射为 Notification 窗口类型,导致 deepin kwin 下 exclusionZone/strut 失效、KeepShowing 边缘预留回归。

回归核对

  • 自动隐藏treeland_window_overlap_checker):按几何检测窗口重叠触发 SmartHide,与 dock 所在 layer 无关,不受影响 ✅
  • 通知中心/OSD 同层叠放:三者本就 Overlay、本就在 dock 之上;改后同属 Overlay,按需映射仍晚于 dock,视觉效果与改前一致 ✅
  • 多屏TreeLandDockWakeUpArea 本就已是 LayerOverlay 先例,无异常 ✅
  • X11 strut:维持 LayerTop(Dock 窗口类型),strut/边缘预留不变 ✅
  • Treeland:未改动 ✅
  • 仅验证 Qt6 链路 ✅

关联

改动文件

  • panels/dock/package/main.qml(1 行实质改动 + 行内注释)

Summary by Sourcery

Bug Fixes:

  • Ensure dock popups appear above notification bubbles on Wayland by raising the dock to the overlay layer while preserving existing behavior on X11.

点击任务栏插件区图标(网络/音量)弹出面板时,通知横幅(bubble)层级显示在面板上层。

根因:dock 为 LayerTop,bubble 为 LayerOverlay,dock 弹窗经 get_popup 继承 dock 层故低于 bubble。
修复:Wayland 下 dock 升至 LayerOverlay,弹窗继承 Overlay 后同层后映射在上压过 bubble。
X11 维持 LayerTop——x11dlayershellemulation 将 LayerOverlay 映射为 Notification 窗口类型,
会导致 KeepShowing 模式下 exclusionZone/strut 失效回归。

Log: 升级 dock 至 LayerOverlay(Wayland) 修复弹窗被通知横幅遮挡
Influence: dock 弹窗与通知横幅/通知中心/OSD 的 z-order 关系

PMS: BUG-373349
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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

sourcery-ai Bot commented Aug 12, 2026

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

Reviewer's Guide

On Wayland, the dock’s layer is raised from LayerTop to LayerOverlay so dock popups inherit Overlay and render above notification bubbles, while preserving existing X11 behavior and strut semantics.

File-Level Changes

Change Details Files
Adjust dock window layer selection by platform so Wayland dock (and its xdg_popups) render in LayerOverlay while X11 remains in LayerTop to avoid strut/exclusionZone regressions.
  • Change DLayerShellWindow.layer from a fixed LayerTop to a conditional expression based on Qt.platform.pluginName, using LayerOverlay on Wayland and LayerTop on non-Wayland (X11).
  • Add inline comments explaining the Wayland layering rationale (bubble vs dock popups) and the X11 caveat where LayerOverlay is mapped to a Notification window type that breaks exclusionZone/strut in KeepShowing mode.
panels/dock/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

@wjyrich wjyrich closed this Aug 12, 2026
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.

2 participants