fix(core): defer output rearrangement to fix VT switch issues#1014
Open
glyvut wants to merge 1 commit into
Open
fix(core): defer output rearrangement to fix VT switch issues#1014glyvut wants to merge 1 commit into
glyvut wants to merge 1 commit into
Conversation
Add a single-shot timer in RootSurfaceContainer to batch surface output updates. This fixes the issue where windows could not be dragged after VT switch by ensuring proper output recovery sequence. 在RootSurfaceContainer中添加单次定时器合并表面输出更新, 修复VT切换后窗口无法拖动等问题。 Log: 修复VT切换后窗口无法拖动的bug PMS: BUG-366537 Influence: 切换VT后窗口可正常拖动,多显示器恢复更平滑
Reviewer's GuideAdds a deferred, single-shot QTimer-based batching mechanism in RootSurfaceContainer to regroup surface-output rearrangement after output add/remove events, fixing VT switch drag issues and smoothing multi-display recovery. Sequence diagram for deferred surface-output rearrangement with QTimersequenceDiagram
participant RootSurfaceContainer
participant QTimer
participant Workspace
RootSurfaceContainer->>QTimer: start(0) Note left of RootSurfaceContainer: addOutput/removeOutput
QTimer-->>QTimer: timeout (singleShot)
QTimer->>RootSurfaceContainer: [lambda connected to timeout]
loop for each surface in surfaces()
RootSurfaceContainer->>RootSurfaceContainer: updateSurfaceOutputs(surface)
end
RootSurfaceContainer->>Workspace: updateSurfacesOwnsOutput()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The lambda connected to
m_outputRearrangeTimer->timeoutduplicates logic that might be reused elsewhere; consider extracting it into a dedicated private method (e.g.rearrangeOutputs()) and calling that from both the timer and any future callers for clarity and easier maintenance. - Instead of calling
m_outputRearrangeTimer->start(0)in multiple places, a small helper likescheduleOutputRearrange()would centralize the batching behavior (including any future changes to delay or conditions) and make the intent of the 0ms single-shot timer more self-documenting.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The lambda connected to `m_outputRearrangeTimer->timeout` duplicates logic that might be reused elsewhere; consider extracting it into a dedicated private method (e.g. `rearrangeOutputs()`) and calling that from both the timer and any future callers for clarity and easier maintenance.
- Instead of calling `m_outputRearrangeTimer->start(0)` in multiple places, a small helper like `scheduleOutputRearrange()` would centralize the batching behavior (including any future changes to delay or conditions) and make the intent of the 0ms single-shot timer more self-documenting.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a single-shot timer in RootSurfaceContainer to batch surface output updates. This fixes the issue where windows could not be dragged after VT switch by ensuring proper output recovery sequence.
在RootSurfaceContainer中添加单次定时器合并表面输出更新,
修复VT切换后窗口无法拖动等问题。
Log: 修复VT切换后窗口无法拖动的bug
PMS: BUG-366537
Influence: 切换VT后窗口可正常拖动,多显示器恢复更平滑
Summary by Sourcery
Defer surface-output rearrangement in the root surface container to batch output updates and improve output recovery after VT switches.
Bug Fixes:
Enhancements: