Skip to content

fix(dock): eliminate several QML runtime/compile warnings - #1711

Draft
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dde-shell-warnings-134
Draft

fix(dock): eliminate several QML runtime/compile warnings#1711
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dde-shell-warnings-134

Conversation

@Ivy233

@Ivy233 Ivy233 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
  1. ShellSurfaceItemProxy: set Connections.ignoreUnknownSignals so the cursorShapeRequested handler no longer warns for surfaces lacking the signal.
  2. TaskManager: replace the deprecated ListView.onAdd NumberAnimation object-to-signal-handler assignment with a declarative add Transition.
  3. TaskManager: break the implicitWidth/implicitHeight binding loop by returning the dock size directly in the spanning layout direction.
  4. AppItem/DragItem/ActionLegacyTrayPluginDelegate: pass an explicit target size to grabToImage to avoid the Ignoring sourceSize request warning.
  5. OverlapNotify: guard the panelShown lookup so an undefined ListView.view no longer assigns undefined to a bool property.
  6. trayitempositionmanager: register the DropIndex gadget as dropIndex lowercase so qmltyperegistrar stops warning about its value-type name.

Log: fix multiple QML warnings reported by journalctl/qmltyperegistrar

Influence:

  1. Verify dock shell surface cursor shape handling still works
  2. Verify task manager item add animation still plays
  3. Verify dock auto-size layout is unchanged
  4. Verify drag image rendering for dock and tray items
  5. Verify notification overlap animation initialization

fix(dock): 消除任务栏与通知中心若干 QML 运行时/注册告警

  1. ShellSurfaceItemProxy:为 Connections 设置 ignoreUnknownSignals, 使 cursorShapeRequested 处理器对缺少该信号的 surface 不再告警。
  2. TaskManager:将弃用的 ListView.onAdd NumberAnimation 对象赋值给 信号处理器的写法改为声明式 add Transition。
  3. TaskManager:在占满布局方向直接返回 dock 尺寸,打断 implicitWidth/implicitHeight 绑定环。
  4. AppItem/DragItem/ActionLegacyTrayPluginDelegate:为 grabToImage 传入 显式目标尺寸,避免 Ignoring sourceSize request 告警。
  5. OverlapNotify:对 panelShown 查询加空值守卫,避免未定义的 ListView.view 将 undefined 赋给 bool 属性。
  6. trayitempositionmanager:将 DropIndex gadget 注册为 dropIndex 小写,使 qmltyperegistrar 不再告警其值类型名。

Log: 修复 journalctl/qmltyperegistrar 报告的多项 QML 告警

Influence:

  1. 验证任务栏 shell surface 光标形状处理仍正常
  2. 验证任务管理器条目添加动画仍播放
  3. 验证任务栏自适应尺寸布局不变
  4. 验证任务栏与托盘条目拖拽图像渲染
  5. 验证通知重叠动画初始化

PMS: TASK-394379

Summary by Sourcery

Remove QML runtime and type-registration warnings across dock, task manager, tray, and notification components while preserving existing behavior.

Bug Fixes:

  • Eliminate QML runtime warnings caused by unknown shell-surface signals, invalid image capture sizing, undefined notification view state, and task manager binding loops.
  • Preserve task item add animations while removing deprecated signal-handler animation syntax.

Enhancements:

  • Prevent dock sizing and tray layout updates from triggering binding loops during layout changes.
  • Register the tray drop-index value type with a compliant lowercase QML name.

@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: Ivy233

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 25, 2026

Copy link
Copy Markdown

Reviewer's Guide

Removes several QML runtime and registration warnings by making signal and view lookups safe, replacing the deprecated task-item add animation syntax, breaking dock sizing binding loops, supplying explicit drag-image sizes, and correcting the tray drop-index QML type name while preserving existing behavior.

Flow diagram for warning-safe dock and notification behavior

flowchart LR
    ShellSurface[Shell surface] -->|cursorShapeRequested| Proxy[ShellSurfaceItemProxy]
    Proxy -->|ignore unknown signals| SafeSignal[Warning-free signal handling]
    TaskModel[Task manager model] --> ListView[ListView]
    ListView -->|add Transition| AddAnimation[Scale and opacity animation]
    DockLayout[Dock layout] -->|useColumnLayout| DockSize[Return dockSize directly]
    DockLayout -->|other direction| ContentSize[Compute content-based size]
    DragItem[Dock or tray item] -->|grabToImage(width,height)| DragImage[Explicit-size drag image]
    ListViewView[ListView.view] -->|exists| Overlap[panelShown lookup]
    ListViewView -->|missing| Disabled[Animation disabled]
    DropIndex[DropIndex gadget] -->|QML_NAMED_ELEMENT| dropIndex[dropIndex value type]
Loading

File-Level Changes

Change Details Files
Make shell-surface signal handling tolerant of surface implementations that do not expose the cursor-shape signal.
  • Enable unknown-signal tolerance on the surface Connections object.
  • Verify cursor shape updates still work when the signal is available.
panels/dock/ShellSurfaceItemProxy.qml
Replace warning-prone task manager sizing and insertion animation patterns with binding-safe declarative implementations.
  • Return the dock size directly in the non-spanning implicit dimension to break the binding loop.
  • Move item add animation from ListView.onAdd to an add Transition while preserving scale and opacity animation.
panels/dock/taskmanager/package/TaskManager.qml
Provide explicit dimensions for drag-image captures across dock and tray delegates.
  • Pass each item's current width and height to grabToImage.
  • Preserve existing drag image assignment and activation behavior.
panels/dock/taskmanager/package/AppItem.qml
panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml
panels/dock/tray/quickpanel/DragItem.qml
Guard notification overlap animation initialization when the delegate is not attached to a ListView.
  • Use a null-safe ListView.view lookup with false as the fallback value.
panels/notification/center/OverlapNotify.qml
Register the tray drop-index value type with the lowercase QML name expected by the type registrar.
  • Replace automatic element naming with QML_NAMED_ELEMENT(dropIndex).
panels/dock/tray/trayitempositionmanager.h

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

@Ivy233
Ivy233 marked this pull request as ready for review August 25, 2026 08:38

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

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.

@Ivy233
Ivy233 marked this pull request as draft August 25, 2026 08:42
@Ivy233
Ivy233 force-pushed the fix/dde-shell-warnings-134 branch from 4d5e6ee to c879751 Compare August 25, 2026 10:09
1. ShellSurfaceItemProxy: set Connections.ignoreUnknownSignals so the
cursorShapeRequested handler no longer warns for surfaces lacking the
signal.
2. TaskManager: replace the deprecated ListView.onAdd NumberAnimation
object-to-signal-handler assignment with a declarative add Transition.
3. TaskManager: break the implicitWidth/implicitHeight binding loop by
returning the dock size directly in the spanning layout direction.
4. AppItem/DragItem/ActionLegacyTrayPluginDelegate: pass an explicit
target size to grabToImage to avoid the Ignoring sourceSize request
warning.
5. OverlapNotify: guard the panelShown lookup so an undefined
ListView.view no longer assigns undefined to a bool property.
6. trayitempositionmanager: register the DropIndex gadget as dropIndex
lowercase so qmltyperegistrar stops warning about its value-type name.
7. trayitempositionmanager: use Qt::QueuedConnection for the
dockHeightChanged -> updateVisualSize connection, breaking the
synchronous C++ signal/slot cascade that causes "Binding loop detected
for dockItemMaxSize". When dockSize changes (e.g. during drag),
dockHeightChanged previously fired synchronously, calling
updateVisualSize -> setProperty("visualSize") -> visualSizeChanged,
which marked dockItemMaxSize dirty (it transitively reads visualSize
via dockRawCenterSpace -> dockRightPart -> tray). Queuing the slot lets
the current binding evaluation finish before visualSize updates.

Log: fix multiple QML warnings reported by journalctl/qmltyperegistrar

Influence:
1. Verify dock shell surface cursor shape handling still works
2. Verify task manager item add animation still plays
3. Verify dock auto-size layout is unchanged
4. Verify drag image rendering for dock and tray items
5. Verify notification overlap animation initialization
6. Verify dock icon size after dragging dock height
7. Verify no "Binding loop for dockItemMaxSize" warnings during drag

fix(dock): 消除任务栏与通知中心若干 QML 运行时/注册告警

1. ShellSurfaceItemProxy:为 Connections 设置 ignoreUnknownSignals,
使 cursorShapeRequested 处理器对缺少该信号的 surface 不再告警。
2. TaskManager:将弃用的 ListView.onAdd NumberAnimation 对象赋值给
信号处理器的写法改为声明式 add Transition。
3. TaskManager:在占满布局方向直接返回 dock 尺寸,打断
implicitWidth/implicitHeight 绑定环。
4. AppItem/DragItem/ActionLegacyTrayPluginDelegate:为 grabToImage 传入
显式目标尺寸,避免 Ignoring sourceSize request 告警。
5. OverlapNotify:对 panelShown 查询加空值守卫,避免未定义的
ListView.view 将 undefined 赋给 bool 属性。
6. trayitempositionmanager:将 DropIndex gadget 注册为 dropIndex
小写,使 qmltyperegistrar 不再告警其值类型名。
7. trayitempositionmanager:将 dockHeightChanged 到 updateVisualSize
的连接改为 Qt::QueuedConnection,打断同步 C++ 信号/槽级联,解决
"Binding loop detected for dockItemMaxSize"。dockSize 变化时(如
拖拽),dockHeightChanged 此前同步触发 updateVisualSize ->
setProperty("visualSize") -> visualSizeChanged,使 dockItemMaxSize
(经 dockRawCenterSpace -> dockRightPart -> tray 间接读取 visualSize)
被标记为脏。改为队列连接后,当前绑定求值可先完成,visualSize 在
下一次事件循环中更新,不再触发绑定环。

Log: 修复 journalctl/qmltyperegistrar 报告的多项 QML 告警

Influence:
1. 验证任务栏 shell surface 光标形状处理仍正常
2. 验证任务管理器条目添加动画仍播放
3. 验证任务栏自适应尺寸布局不变
4. 验证任务栏与托盘条目拖拽图像渲染
5. 验证通知重叠动画初始化
6. 验证拖拽任务栏高度后图标尺寸正确
7. 验证拖拽时不再出现 "Binding loop for dockItemMaxSize" 告警

PMS: TASK-394379
@Ivy233
Ivy233 force-pushed the fix/dde-shell-warnings-134 branch from c879751 to c2e1cec Compare August 25, 2026 12:53
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