分屏动效与四分屏 - #1289
分屏动效与四分屏#1289
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's GuideThe PR adds configurable four-way corner tiling by classifying pointer positions within edge trigger zones, extends quick-tile geometry for the four quadrants, and implements an animated preview that transitions from the dragged window’s current geometry to the selected tile. Sequence diagram for animated edge-tile previewsequenceDiagram
participant User
participant SeatSurfaceManager
participant RootSurfaceContainer
participant EdgeTilePreview
participant QuickTile
User->>SeatSurfaceManager: Move window into edge zone
SeatSurfaceManager->>RootSurfaceContainer: updateEdgeTilePreview(mode, output, seat)
RootSurfaceContainer->>QuickTile: geometry(mode, output)
QuickTile-->>RootSurfaceContainer: target tile geometry
RootSurfaceContainer->>RootSurfaceContainer: moveResizeSurface()->geometry()
RootSurfaceContainer->>EdgeTilePreview: set sourceGeometry and targetGeometry
RootSurfaceContainer->>EdgeTilePreview: setVisible(true)
EdgeTilePreview->>EdgeTilePreview: applyGeometry(sourceGeometry)
EdgeTilePreview->>EdgeTilePreview: applyGeometry(targetGeometry)
EdgeTilePreview-->>User: Animate preview to selected tile
Flow diagram for pointer-driven quadrant tilingflowchart TD
A[Pointer position during window move] --> B{Within edge trigger zone?}
B -- No --> C[No edge tile mode]
B -- Yes --> D{Edge and vertical zone}
D -- Left + top --> E[TopLeft]
D -- Left + middle --> F[Left]
D -- Left + bottom --> G[BottomLeft]
D -- Right + top --> H[TopRight]
D -- Right + middle --> I[Right]
D -- Right + bottom --> J[BottomRight]
D -- Top edge --> K[Maximize]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
6a586e3 to
e1fd907
Compare
|
TAG Bot New tag: 0.9.0 |
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="src/core/qml/EdgeTilePreview.qml" line_range="43-44" />
<code_context>
+ }
+
+ onTargetGeometryChanged: {
+ if (visible)
+ applyGeometry(targetGeometry)
+ }
+
</code_context>
<issue_to_address>
**issue (bug_risk):** When the preview is already visible and the detected tile mode changes, changing `targetGeometry` immediately animates from the preview's previous target geometry. The newly assigned `sourceGeometry` is never applied, so the preview does not animate from the dragged window's current geometry as intended.
**Triggers:** When the pointer moves directly between two active edge-tile zones without first hiding the preview.
**Suggested fix:** When `targetGeometry` changes while visible, first apply `sourceGeometry` with animation disabled, then apply the new target with animation enabled, or restart an explicit animation from the current dragged-surface geometry.
```suggestion
if (visible) {
animationEnabled = false
applyGeometry(sourceGeometry)
animationEnabled = true
applyGeometry(targetGeometry)
}
```
</issue_to_address>
### Comment 2
<location path="src/core/rootsurfacecontainer.cpp" line_range="912" />
<code_context>
auto *cfg = Helper::instance()->config();
const qreal sideTrigger = cfg ? qreal(cfg->edgeSideTriggerDistance()) : 20.0;
const qreal topTrigger = cfg ? qreal(cfg->edgeTopTriggerDistance()) : 5.0;
+ const qreal quadRatio = cfg ? qreal(cfg->edgeQuadrantZoneRatio()) : 0.25;
auto &mrState = container->moveResizeState();
QuickTile::Mode mode = QuickTile::Mode::None;
</code_context>
<issue_to_address>
**issue (bug_risk):** `quadRatio` is used without validation, so a configured ratio below 0 or above 0.5 makes the quadrant thresholds invalid: negative values disable corner zones, while values above 0.5 make the top zone overlap the bottom zone and effectively eliminate half-screen and bottom-corner detection.
**Triggers:** When the user configures `edgeQuadrantZoneRatio` outside the intended 0–0.5 range.
**Suggested fix:** Clamp the value to a valid range before calculating `quadTop` and `quadBottom`, and constrain or validate the dconfig value accordingly.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 0.9.1 |
|
TAG Bot New tag: 0.10.0 |
There was a problem hiding this comment.
🟡 Changes recommended
Constrain and document the ratio range, and remove the unreachable duplicate code.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds configurable animated four-way edge tiling with quadrant-zone detection.
Changes:
- Adds quadrant tile modes and geometry calculations.
- Adds configurable quadrant detection ratio.
- Animates tile previews from the window’s current geometry.
File summaries
| File | Summary |
|---|---|
src/surface/surfacewrapper.h |
Adds quadrant tile modes. |
src/surface/seatsurfacemanager.cpp |
Passes seat context to preview updates. |
src/output/output.cpp |
Calculates half-screen and quadrant geometries. |
src/core/rootsurfacecontainer.h |
Extends the preview update API. |
src/core/rootsurfacecontainer.cpp |
Implements quadrant detection and preview animation. Moderate finding (3 votes) and nit (2 votes) remain. |
src/core/qml/EdgeTilePreview.qml |
Animates preview geometry transitions. |
misc/dconfig/org.deepin.dde.treeland.user.json |
Adds the quadrant-zone ratio setting. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add TopLeft/TopRight/BottomLeft/BottomRight edge tiling modes so dragging to the corner zones of the left/right edges tiles to a quarter of the screen. Add edgeQuadrantZoneRatio dconfig to tune the corner trigger area ratio. 边缘平铺新增四分之一屏(角落象限)模式,光标位于左右边缘上下角落 区域时平铺到屏幕四分之一处,中间区域保持半屏平铺。新增 edgeQuadrantZoneRatio配置项控制角落触发区域比例。 Log: 支持四分之一屏边缘平铺 Influence: 边缘拖拽平铺新增角落象限模式,可平铺到屏幕四分之一区域。
Animate the edge tile preview so it smoothly grows from the dragged surface's current geometry to the target tile area (250ms), mirroring KWin's outline effect. Pass the seat to updateEdgeTilePreview to obtain the source geometry. 边缘平铺预览增加动效:从被拖拽窗口的当前位置平滑动画过渡到目标 平铺区域(250ms),与KWin轮廓效果一致。updateEdgeTilePreview新增 seat参数以获取拖拽窗口的几何位置。 Log: 边缘平铺预览增加动效 Influence: 拖拽边缘预览时显示平滑过渡动画,视觉反馈更清晰。
There was a problem hiding this comment.
🔵 Needs a closer look
Restart the preview animation when the source geometry changes while the preview is visible.
Review details
Suppressed comments (1)
src/core/qml/EdgeTilePreview.qml:45
- When the cursor changes from a half-screen zone to a corner (or to another output),
updateEdgeTilePreview()updatessourceGeometrywhile the preview is already visible, but this QML only consumessourceGeometryinonVisibleChanged. The subsequent target update therefore animates from the previous preview position rather than the dragged surface's current geometry, so the advertised source-to-target animation is only correct for the first show. Restart the visible animation fromsourceGeometrywhen the source changes, while batching the source/target updates so the new target is used.
onTargetGeometryChanged: {
if (visible)
applyGeometry(targetGeometry)
}
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glyvut, wineee 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 |
Summary by Sourcery
Support animated edge previews and configurable four-way screen tiling for dragged windows.
New Features:
Enhancements: