Repository navigation
fix(layershell): stabilize compositor interactive resize (u3) - #1845
Conversation
1. Add TreelandProtocols to the top-level build and generate the layer shell extension protocol in frame 2. Introduce TreeLandLayerShellExtensionManager and extension object wrappers in the frame module 3. Implement interactive resize in QWaylandLayerShellSurface via QWaylandShellSurface::resize 4. Expose resizing state and resizeFinished signal on DLayerShellWindow 5. Avoid resize loops by skipping geometry echo during configure and syncing layout on interactive resize 6. Remove the dock-local extension implementation and drive resize from QML system resize Log: Centralize compositor-driven layer surface resizing in the frame module Influence: Layer surfaces gain unified interactive resize support via the shell surface API refactor(layershell): 将 treeland 缩放能力下沉至图层壳表面 1. 顶层构建引入 TreelandProtocols,并在 frame 中生成图层壳扩展协议 2. 在 frame 模块新增 TreeLandLayerShellExtensionManager 及扩展对象封装 3. 通过 QWaylandShellSurface::resize 在 QWaylandLayerShellSurface 中实现 交互式缩放 4. 在 DLayerShellWindow 上暴露 resizing 状态与 resizeFinished 信号 5. configure 期间跳过几何回传并在交互缩放时同步布局,避免缩放循环 6. 移除 dock 内的扩展实现,改由 QML 系统缩放驱动 Log: 将合成器驱动的图层表面缩放能力统一收敛到 frame 模块 Influence: 图层表面通过壳表面接口获得统一的交互式缩放支持 PMS: BUG-295957 (cherry picked from commit d86bbe1)
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun, wjyrich 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 |
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/package/main.qml" line_range="798-800" />
<code_context>
+ const edge = Panel.position === Dock.Top ? Qt.BottomEdge
+ : Panel.position === Dock.Bottom ? Qt.TopEdge
+ : Panel.position === Dock.Left ? Qt.RightEdge : Qt.LeftEdge
+ if (!dock.startSystemResize(edge))
+ finishResize()
+ return
}
DS.grabMouse(Panel.rootObject, true)
</code_context>
<issue_to_address>
**Dock resizing stops on other compositors**
When the dock runs on a non-XCB Wayland compositor where the Treeland resize extension is inactive, the failed system-resize request calls `finishResize()` and returns before the manual `DS.grabMouse` fallback; subsequent pointer movement is also ignored in compositor-driven mode, so dock resizing does not work.
Fall back to the manual drag path when `startSystemResize` returns false, or enable compositor-driven resizing only when the Treeland extension is available.
</issue_to_address>
### Comment 2
<location path="frame/layershell/qwaylandlayershellsurface.cpp" line_range="70-72" />
<code_context>
QWaylandLayerShellSurface::~QWaylandLayerShellSurface()
{
+ m_shellExtension.reset();
+ if (m_dlayerShellWindow)
+ m_dlayerShellWindow->setResizing(false);
destroy();
}
</code_context>
<issue_to_address>
**Final dock size is lost**
When the output changes while a resize is active and the latest configure has not yet been applied, the surface destructor clears the resizing state without calling `finishResize()`, so it never adopts `m_pendingSize` or emits `resizeFinished`. The QML resizing-state handler then persists the last reflected `dockSize`, which can be older than the final configure, and the recreated surface shows the wrong size.
Finalize and persist the pending resize size before destroying the shell surface during recreation.
</issue_to_address>
### Comment 3
<location path="panels/dock/package/main.qml" line_range="906" />
<code_context>
+ Applet.dockSize = dock.useColumnLayout ? size.width : size.height
+ }
+ function onResizingChanged() {
+ if (!dock.DLayerShellWindow.resizing && dock.isDragging) {
dragArea.finishResize()
}
</code_context>
<issue_to_address>
**Final dock size gets overwritten**
When the last compositor configure has not yet updated `dockSize` when the resize-finished signals are handled, and `dockSize` is not bound to the updated `Applet.dockSize`, `finishResize()` runs after `resizeFinished` and writes `dockSize` back to `Applet.dockSize`; if `dockSize` no longer follows that property and Qt has not applied the last configure yet, this replaces the final compositor size with the older value the user sees and persists.
Use the final size from `resizeFinished` as the value saved by `finishResize`, or ensure the dock's displayed size is updated before that handler persists it.
Also at `panels/dock/package/main.qml:903`.
</issue_to_address>| if (!dock.startSystemResize(edge)) | ||
| finishResize() | ||
| return |
There was a problem hiding this comment.
🟡 Medium · Dock resizing stops on other compositors
When the dock runs on a non-XCB Wayland compositor where the Treeland resize extension is inactive, the failed system-resize request calls finishResize() and returns before the manual DS.grabMouse fallback; subsequent pointer movement is also ignored in compositor-driven mode, so dock resizing does not work.
Fall back to the manual drag path when startSystemResize returns false, or enable compositor-driven resizing only when the Treeland extension is available.
Prompt for AI agents
In `panels/dock/package/main.qml` at lines 798-800:
**Dock resizing stops on other compositors**
When the dock runs on a non-XCB Wayland compositor where the Treeland resize extension is inactive, the failed system-resize request calls `finishResize()` and returns before the manual `DS.grabMouse` fallback; subsequent pointer movement is also ignored in compositor-driven mode, so dock resizing does not work.
Fall back to the manual drag path when `startSystemResize` returns false, or enable compositor-driven resizing only when the Treeland extension is available.| m_shellExtension.reset(); | ||
| if (m_dlayerShellWindow) | ||
| m_dlayerShellWindow->setResizing(false); |
There was a problem hiding this comment.
🟡 Medium · Final dock size is lost
When the output changes while a resize is active and the latest configure has not yet been applied, the surface destructor clears the resizing state without calling finishResize(), so it never adopts m_pendingSize or emits resizeFinished. The QML resizing-state handler then persists the last reflected dockSize, which can be older than the final configure, and the recreated surface shows the wrong size.
Finalize and persist the pending resize size before destroying the shell surface during recreation.
Prompt for AI agents
In `frame/layershell/qwaylandlayershellsurface.cpp` at lines 70-72:
**Final dock size is lost**
When the output changes while a resize is active and the latest configure has not yet been applied, the surface destructor clears the resizing state without calling `finishResize()`, so it never adopts `m_pendingSize` or emits `resizeFinished`. The QML resizing-state handler then persists the last reflected `dockSize`, which can be older than the final configure, and the recreated surface shows the wrong size.
Finalize and persist the pending resize size before destroying the shell surface during recreation.| Applet.dockSize = dock.useColumnLayout ? size.width : size.height | ||
| } | ||
| function onResizingChanged() { | ||
| if (!dock.DLayerShellWindow.resizing && dock.isDragging) { |
There was a problem hiding this comment.
🟡 Medium · Final dock size gets overwritten
When the last compositor configure has not yet updated dockSize when the resize-finished signals are handled, and dockSize is not bound to the updated Applet.dockSize, finishResize() runs after resizeFinished and writes dockSize back to Applet.dockSize; if dockSize no longer follows that property and Qt has not applied the last configure yet, this replaces the final compositor size with the older value the user sees and persists.
Use the final size from resizeFinished as the value saved by finishResize, or ensure the dock's displayed size is updated before that handler persists it.
Also at panels/dock/package/main.qml:903.
Prompt for AI agents
In `panels/dock/package/main.qml` at line 906:
**Final dock size gets overwritten**
When the last compositor configure has not yet updated `dockSize` when the resize-finished signals are handled, and `dockSize` is not bound to the updated `Applet.dockSize`, `finishResize()` runs after `resizeFinished` and writes `dockSize` back to `Applet.dockSize`; if `dockSize` no longer follows that property and Qt has not applied the last configure yet, this replaces the final compositor size with the older value the user sees and persists.
Use the final size from `resizeFinished` as the value saved by `finishResize`, or ensure the dock's displayed size is updated before that handler persists it.
Also at `panels/dock/package/main.qml:903`.
Backport #1841 to
develop/2500u3to stabilize compositor-driven dock resizing.Move the Treeland layer-shell extension into the shared frame component and drive dock resizing through Qt's system resize API. Synchronize configure handling, resize state and final dock size to avoid geometry feedback loops and jumps when dragging ends.
Source commit:
d86bbe13818fca7462cd30d05090e61c8afb6715.Cherry-picked with
-xwithout conflicts; the stable patch ID matches the source commit.Validation:
git diff --check upstream/develop/2500u3...HEAD: passed.BUILD_TESTING=ON: passed.dockpanelbuild, includingdde-shell-frameanddde-shell-dock: passed.qmlformatparsing ofpanels/dock/package/main.qml: passed.将 #1841 无冲突回移到
develop/2500u3:把 Treeland 缩放协议实现下沉到 frame,由 Qt 系统缩放接口驱动任务栏拖拽,并同步 configure、缩放状态和最终尺寸。补丁与原提交一致;相关目标编译、QML 语法和空白检查均通过,Treeland 会话中的运行时行为尚未验证。Log: 稳定合成器驱动的任务栏交互式缩放
Influence: 避免任务栏拖拽结束时尺寸跳动和循环缩放
PMS: BUG-295957
Summary by Sourcery
Stabilize interactive dock resizing by centralizing Treeland layer-shell support and synchronizing compositor configure handling with final dock geometry.
Bug Fixes:
Enhancements:
Build:
Chores: