Repository navigation
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glyvut The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideWindowless dock application tooltips now render through Treeland on Wayland via a new requestTooltip path, while X11 retains native tooltips. The Treeland dock preview context is created lazily and reused for both tooltip and window previews, enabling continuous transitions when an application gains windows during hover. Sequence diagram for Wayland windowless app tooltip renderingsequenceDiagram
actor User
participant AppItem
participant TaskManager
participant WindowMonitor
participant Treeland
User->>AppItem: onEntered()
AppItem->>TaskManager: requestTooltip(text, Panel.rootObject, xOffset, yOffset, direction)
TaskManager->>WindowMonitor: requestTooltip(text, relativePositionItem, xOffset, yOffset, direction)
WindowMonitor->>WindowMonitor: ensureDockPreviewContext(relativePositionItem)
WindowMonitor->>Treeland: get_dock_preview_context(wlSurface)
WindowMonitor->>Treeland: show_tooltip(text, xOffset, yOffset, direction)
Treeland-->>User: Render compositor tooltip
Sequence diagram for tooltip to window preview transitionsequenceDiagram
actor User
participant AppItem
participant TaskManager
participant WindowMonitor
participant Treeland
User->>AppItem: onEntered()
AppItem->>TaskManager: requestTooltip(text, Panel.rootObject, xOffset, yOffset, direction)
TaskManager->>WindowMonitor: requestTooltip(text, relativePositionItem, xOffset, yOffset, direction)
WindowMonitor->>Treeland: show_tooltip(text, xOffset, yOffset, direction)
AppItem->>AppItem: windows change from empty to non-empty
AppItem->>TaskManager: requestPreview(modelIndex, Panel.rootObject, xOffset, yOffset, direction)
TaskManager->>WindowMonitor: requestPreview(sourceModel, relativePositionItem, xOffset, yOffset, direction)
WindowMonitor->>Treeland: showWindowsPreview(windowIds, xOffset, yOffset, direction)
Treeland-->>User: Animate from tooltip to window preview
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
5e03ba8 to
d847bad
Compare
|
TAG Bot New tag: 2.0.60 |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/taskmanager/package/AppItem.qml" line_range="439" />
<code_context>
sourceSize: Qt.size(Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE, Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE)
}
+ readonly property bool useCompositorTooltip: Qt.platform.pluginName === "wayland"
+ property bool compositorTooltipActive: false
+ function compositorTooltipApplet() {
</code_context>
<issue_to_address>
**Wayland tooltips disappear**
When the dock runs on Wayland and the Treeland foreign-toplevel manager or protocol is unavailable or inactive, `useCompositorTooltip` selects the compositor path, so the QML callers skip or suppress `PanelToolTip`; `requestTooltip` then returns without displaying a tooltip or reporting success. Windowless-app and multitasking-view tooltips disappear.
Use the compositor path only when the Treeland protocol is available and active, or fall back to `PanelToolTip` when `requestTooltip` cannot display the tooltip.
Also at `panels/dock/multitaskview/package/multitaskview.qml:37`, `panels/dock/multitaskview/package/multitaskview.qml:81-82`, `panels/dock/taskmanager/package/AppItem.qml:465-467`, `panels/dock/taskmanager/package/AppItem.qml:472`, `panels/dock/taskmanager/treelandwindowmonitor.cpp:203-205`.
</issue_to_address>
### Comment 2
<location path="panels/dock/taskmanager/package/AppItem.qml" line_range="491" />
<code_context>
+ // 无窗口应用:交给合成器绘制 tooltip,以便与窗口预览保持连续的过渡动画
+ tooltipTimer.xOffset = xOffset
+ tooltipTimer.yOffset = yOffset
+ tooltipTimer.start()
+ return
+ }
</code_context>
<issue_to_address>
**Click leaves tooltip visible**
When the user presses the app before the 50 ms tooltip delay expires, `tooltipTimer` can fire after the user presses the windowless app: the press handler closes the native tooltip and preview but does not stop this timer. Its callback then requests a compositor tooltip while the app is being launched.
Stop `tooltipTimer` in the press handler before closing the tooltip or preview.
</issue_to_address>8a2a8fc to
c1748f5
Compare
Add requestTooltip to the window monitor and route the plain-text tooltip of app items without windows through the treeland dock preview context, so the compositor can animate between tooltip and window preview. The preview context is now created lazily and shared by both requests. 无窗口应用的悬停提示改由合成器绘制,preview context 改为惰性创建并 在预览与 tooltip 之间复用,使两者切换动画连续。 Log: 无窗口应用的 tooltip 交由合成器绘制 PMS: TASK-396711 Influence: wayland(treeland)下无窗口应用的 tooltip 由合成器绘制,与窗口预览切换更连贯;X11 行为不变。
Resolve the task manager applet of the same dock panel and reuse its dock preview context, so the multitasking view tooltip is drawn by the compositor on wayland and falls back to PanelToolTip otherwise. 多任务视图在 wayland 下复用同面板 taskmanager 的 dock preview context, 由合成器绘制 tooltip;其余情况回退到 PanelToolTip。 Log: 多任务视图 tooltip 改用合成器绘制 PMS: TASK-396711 Influence: wayland 下多任务视图 tooltip 与任务栏 tooltip 一致;找不到 taskmanager 或非 wayland 时行为不变。
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['multitaskview.qml toolTipShowTimer.onTriggered 中 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['建议将 treelandwindowmonitor.cpp 中的 qWarning() 替换为 qCWarning(taskManagerLog) 以保持日志分类一致性。', '建议在 ensureDockPreviewContext() 开头添加 if (!m_foreignToplevelManager) return; 使函数自包含。'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['可考虑在 compositorTooltipActive 状态变更时缓存 compositorTooltipApplet() 的返回值,避免重复遍历。'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// treelandwindowmonitor.cpp - 建议在 ensureDockPreviewContext 中添加防御性 null 检查
void TreeLandWindowMonitor::ensureDockPreviewContext(QWindow *relativePositionItem)
{
if (!m_dockPreview.isNull())
return;
if (!m_foreignToplevelManager) // 防御性检查,使函数自包含
return;
auto window = relativePositionItem;
if (!window) return;
auto waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow*>(window->handle());
if (!waylandWindow) return;
auto context = m_foreignToplevelManager->get_dock_preview_context(waylandWindow->wlSurface());
m_dockPreview.reset(new TreeLandDockPreviewContext(context));
connect(window, &QWindow::visibleChanged, m_dockPreview.get(), [this]() {
m_dockPreview.reset();
});
connect(m_dockPreview.get(), &TreeLandDockPreviewContext::closed, this, [this]() {
emit previewShouldClear();
});
}
// treelandwindowmonitor.cpp - 建议统一日志分类
// 将 qWarning() 替换为 qCWarning(taskManagerLog)
qCWarning(taskManagerLog) << "requestPreview called without any window";
qCWarning(taskManagerLog) << "requestPreview called without any valid window id";本报告由 AI 代码审查工具自动生成 |
| sourceSize: Qt.size(Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE, Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE) | ||
| } | ||
|
|
||
| readonly property bool useCompositorTooltip: Qt.platform.pluginName === "wayland" |
There was a problem hiding this comment.
能否给dock定制一个PanelToolTip,覆盖掉dde-shell提供的默认的实现,
在这个控件里区分是x11还是treeland,在treeland情况下调用预览的show_tooltip接口,在x11下保持原来的,沿用PanelToolTipWindow去实现,
ToolTip相对位置,文本等,PanelToolTip已经存在已有的接口现,只有显示时不一样,
dde-shell不仅仅只有这几个tooltip,还有启动器等插件,
Add requestTooltip to the window monitor and route the plain-text tooltip
of app items without windows through the treeland dock preview context,
so the compositor can animate between tooltip and window preview.
The preview context is now created lazily and shared by both requests.
无窗口应用的悬停提示改由合成器绘制,preview context 改为惰性创建并
在预览与 tooltip 之间复用,使两者切换动画连续。
Log: 无窗口应用的 tooltip 交由合成器绘制
PMS: TASK-396711
Influence: wayland(treeland)下无窗口应用的 tooltip 由合成器绘制,与窗口预览切换更连贯;X11 行为不变。
Summary by Sourcery
Support compositor-rendered tooltips for windowless dock applications while preserving fallback behavior and smooth transitions to window previews.
New Features:
Bug Fixes:
Enhancements: