Skip to content

feat: implement shadow and border protocol, disable layershell decorations by default - #1126

Open
18202781743 wants to merge 1 commit into
linuxdeepin:master-backup-20260717from
18202781743:master
Open

feat: implement shadow and border protocol, disable layershell decorations by default#1126
18202781743 wants to merge 1 commit into
linuxdeepin:master-backup-20260717from
18202781743:master

Conversation

@18202781743

Copy link
Copy Markdown
Contributor
  1. Implement SurfaceShadow and SurfaceBorder structures with Q_PROPERTY
    for QML exposure
  2. Add shadow and border properties to SurfaceWrapper, with default
    values for non-layer surfaces
  3. Update XdgShadow QML component to read shadow properties from surface
    (radius, offset, color)
  4. Update Border QML component to read border properties from surface
    (width, color)
  5. Connect Personalization signals (shadowChanged, borderChanged) to
    update SurfaceWrapper properties
  6. Disable shadow and border decorations by default for LayerShell
    surfaces (m_type != Type::Layer)
  7. Set default shadow: radius 40, offsetX 0, offsetY 10, color
    rgba(0,0,0,0.4)
  8. Set default border: width 1, color rgba(255,255,255,0.1)
  9. Fix noDecoration property inheritance in SurfaceWrapper copy
    constructor
  10. Pass surface property to XdgShadow and Border QML components for
    data binding
  11. Update createXdgShadow function signature to accept SurfaceWrapper
    parameter

Log: Implement shadow and border protocol for surfaces, disable
layershell decorations by default

Influence:

  1. Test shadow rendering for non-layer surfaces (radius, offset, color)
  2. Test border rendering for non-layer surfaces (width, color)
  3. Verify LayerShell surfaces have no decorations by default
  4. Test shadow and border property updates via Personalization interface
  5. Verify noDecoration property inheritance in surface cloning
  6. Test animations with combined shadow and border effects
  7. Verify shadows work with proxy surfaces (minimized windows, etc.)

feat: 实现阴影和边框协议,默认关闭层壳装饰

  1. 实现 SurfaceShadow 和 SurfaceBorder 结构体,包含 Q_PROPERTY 以便 QML
    使用
  2. 为 SurfaceWrapper 添加阴影和边框属性,非层壳表面使用默认值
  3. 更新 XdgShadow QML 组件,从 surface 读取阴影属性(半径、偏移、颜色)
  4. 更新 Border QML 组件,从 surface 读取边框属性(宽度、颜色)
  5. 连接 Personalization 信号(shadowChanged、borderChanged)以更新
    SurfaceWrapper 属性
  6. 默认禁用 LayerShell 表面的阴影和边框装饰(m_type != Type::Layer)
  7. 设置默认阴影:半径 40,偏移 X 0,偏移 Y 10,颜色 rgba(0,0,0,0.4)
  8. 设置默认边框:宽度 1,颜色 rgba(255,255,255,0.1)
  9. 修复 SurfaceWrapper 拷贝构造函数中的 noDecoration 属性继承
  10. 将 surface 属性传递给 XdgShadow 和 Border QML 组件以进行数据绑定
  11. 更新 createXdgShadow 函数签名,接受 SurfaceWrapper 参数

Log: 实现表面阴影和边框协议,默认关闭层壳装饰

Influence:

  1. 测试非层壳表面的阴影渲染(半径、偏移、颜色)
  2. 测试非层壳表面的边框渲染(宽度、颜色)
  3. 验证 LayerShell 表面默认无装饰
  4. 测试通过 Personalization 接口更新阴影和边框属性
  5. 验证表面克隆时的 noDecoration 属性继承
  6. 测试结合阴影和边框效果的动画
  7. 验证代理表面(最小化窗口等)的阴影效果

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

Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

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

Copy link
Copy Markdown
Contributor Author

@wineee @Groveer

Comment thread src/surface/surfacewrapper.cpp Outdated
Comment thread src/surface/surfacewrapper.cpp Outdated
decorations by default

1. Implement SurfaceShadow and SurfaceBorder structures with Q_PROPERTY
for QML exposure
2. Add shadow and border properties to SurfaceWrapper, with default
values for non-layer surfaces
3. Update XdgShadow QML component to read shadow properties from surface
(radius, offset, color)
4. Update Border QML component to read border properties from surface
(width, color)
5. Connect Personalization signals (shadowChanged, borderChanged) to
update SurfaceWrapper properties
6. Disable shadow and border decorations by default for LayerShell
surfaces (m_type != Type::Layer)
7. Set default shadow: radius 40, offsetX 0, offsetY 10, color
rgba(0,0,0,0.4)
8. Set default border: width 1, color rgba(255,255,255,0.1)
9. Fix noDecoration property inheritance in SurfaceWrapper copy
constructor
10. Pass surface property to XdgShadow and Border QML components for
data binding
11. Update createXdgShadow function signature to accept SurfaceWrapper
parameter

Log: Implement shadow and border protocol for surfaces, disable
layershell decorations by default

Influence:
1. Test shadow rendering for non-layer surfaces (radius, offset, color)
2. Test border rendering for non-layer surfaces (width, color)
3. Verify LayerShell surfaces have no decorations by default
4. Test shadow and border property updates via Personalization interface
5. Verify noDecoration property inheritance in surface cloning
6. Test animations with combined shadow and border effects
7. Verify shadows work with proxy surfaces (minimized windows, etc.)

feat: 实现阴影和边框协议,默认关闭层壳装饰

1. 实现 SurfaceShadow 和 SurfaceBorder 结构体,包含 Q_PROPERTY 以便 QML
使用
2. 为 SurfaceWrapper 添加阴影和边框属性,非层壳表面使用默认值
3. 更新 XdgShadow QML 组件,从 surface 读取阴影属性(半径、偏移、颜色)
4. 更新 Border QML 组件,从 surface 读取边框属性(宽度、颜色)
5. 连接 Personalization 信号(shadowChanged、borderChanged)以更新
SurfaceWrapper 属性
6. 默认禁用 LayerShell 表面的阴影和边框装饰(m_type != Type::Layer)
7. 设置默认阴影:半径 40,偏移 X 0,偏移 Y 10,颜色 rgba(0,0,0,0.4)
8. 设置默认边框:宽度 1,颜色 rgba(255,255,255,0.1)
9. 修复 SurfaceWrapper 拷贝构造函数中的 noDecoration 属性继承
10. 将 surface 属性传递给 XdgShadow 和 Border QML 组件以进行数据绑定
11. 更新 createXdgShadow 函数签名,接受 SurfaceWrapper 参数

Log: 实现表面阴影和边框协议,默认关闭层壳装饰

Influence:
1. 测试非层壳表面的阴影渲染(半径、偏移、颜色)
2. 测试非层壳表面的边框渲染(宽度、颜色)
3. 验证 LayerShell 表面默认无装饰
4. 测试通过 Personalization 接口更新阴影和边框属性
5. 验证表面克隆时的 noDecoration 属性继承
6. 测试结合阴影和边框效果的动画
7. 验证代理表面(最小化窗口等)的阴影效果
@deepin-bot

deepin-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.8.15
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1163

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds per-surface shadow and border data to SurfaceWrapper (C++/QML), wires Personalization updates into those properties, and updates QML decoration components to render using the new surface-provided parameters—while aiming to keep LayerShell surfaces decoration-free by default.

本 PR 为 SurfaceWrapper 增加阴影与边框数据结构并暴露给 QML,同时把 Personalization 的更新信号接入这些属性;并更新 QML 装饰组件从 surface 读取参数进行绘制,同时期望 LayerShell 默认无装饰。

Changes / 变更:

  • Expose SurfaceShadow / SurfaceBorder as SurfaceWrapper QML properties and propagate cloning.
    SurfaceShadow / SurfaceBorder 作为 SurfaceWrapper 的 QML 属性暴露,并在拷贝构造中继承。
  • Update XdgShadow/Border QML to bind to surface.shadow / surface.border, and pass surface through component creation.
    更新 XdgShadow/Border QML 绑定到 surface.shadow / surface.border,并在组件创建/使用处传递 surface
  • Hook Personalization shadowChanged / borderChanged to update wrapper properties.
    连接 Personalization 的 shadowChanged / borderChanged 以更新 wrapper 属性。

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/surface/surfacewrapper.h Introduces SurfaceShadow/SurfaceBorder gadgets and adds them as QML properties on SurfaceWrapper.
src/surface/surfacewrapper.cpp Initializes defaults for non-layer surfaces; adds shadow()/setShadow() and border()/setBorder(); fixes copy ctor m_noDecoration inheritance.
src/surface/surfaceproxy.cpp Updates shadow creation call to pass the source SurfaceWrapper into createXdgShadow.
src/seat/helper.cpp Wires Personalization shadow/border signals to update SurfaceWrapper properties.
src/modules/personalization/personalizationmanagerinterfacev1.h Sets default initial values for personalization Shadow/Border structs.
src/core/qmlengine.h Updates createXdgShadow signature to accept SurfaceWrapper*.
src/core/qmlengine.cpp Passes surface into XdgShadow component as an initial property.
src/core/qml/XdgShadow.qml Binds shadow rendering parameters to surface.shadow.* and requires a surface property.
src/core/qml/Decoration.qml Passes surface into XdgShadow/Border instances for data binding.
src/core/qml/Border.qml Binds outside border width/color to surface.border.* and requires a surface property.
src/core/qml/Animations/GeometryAnimation.qml Passes surface into XdgShadow instance used during geometry animations.
Comments suppressed due to low confidence (1)

src/surface/surfacewrapper.cpp:1729

  • EN: Same issue as shadow: setBorder() applies the non-layer default border when width == -1, which would re-enable LayerShell borders if -1 is used as an “inherit” sentinel. The fallback should respect m_type so LayerShell stays decoration-free by default.

ZH: 与阴影同理:setBorder()width == -1 时会直接套用非 Layer 的默认边框(width=1),如果 -1 被用作“继承默认值”的哨兵值,会导致 LayerShell 默认又出现边框。建议同样根据 m_type 分支处理。

    SurfaceBorder newBorder = border;
    if (newBorder.width == -1) {
        newBorder = SurfaceBorder{ 1, QColor(255, 255, 255, 26) };
    }

Comment on lines 20 to +24
struct Shadow
{
int32_t radius;
QPoint offset;
QColor color;
int32_t radius = 0;
QPoint offset = {};
QColor color = Qt::transparent;
Comment on lines +1708 to +1711
SurfaceShadow newShadow = shadow;
if (newShadow.radius == -1) {
newShadow = SurfaceShadow{ 40, 0, 10, QColor(0, 0, 0, 102) };
}
Comment thread src/core/qml/Border.qml
Comment on lines +11 to 15
required property SurfaceWrapper surface

property real radius: 0
property color outsideColor: Qt.rgba(0, 0, 0, 0.1)
property color insideColor: Qt.rgba(255, 255, 255, 0.1)

XdgShadow {
surface: root.surface
anchors.fill: parent
visible: surface.visibleDecoration && !surface.noDecoration
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