分屏动效与四分屏 - #1289
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 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 |
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.
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.
| if (visible) | ||
| applyGeometry(targetGeometry) |
There was a problem hiding this comment.
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.
| if (visible) | |
| applyGeometry(targetGeometry) | |
| if (visible) { | |
| animationEnabled = false | |
| applyGeometry(sourceGeometry) | |
| animationEnabled = true | |
| applyGeometry(targetGeometry) | |
| } |
| 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; |
There was a problem hiding this comment.
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.
|
TAG Bot New tag: 0.9.1 |
Summary by Sourcery
Add animated four-way edge tiling with configurable quadrant zones.
New Features:
Enhancements: