fix: resolve abnormal compositor window size due to popup panel heigh…#1535
Open
yixinshark wants to merge 1 commit intolinuxdeepin:masterfrom
Open
fix: resolve abnormal compositor window size due to popup panel heigh…#1535yixinshark wants to merge 1 commit intolinuxdeepin:masterfrom
yixinshark wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yixinshark 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 GuideRefactors popup panel sizing to use separate requested dimensions and a native setWindowGeometry call, preventing Wayland-driven resize loops from corrupting compositor window geometry when the popup panel size changes. Sequence diagram for popup window geometry update on panel resizesequenceDiagram
participant PluginPanel
participant PanelPopupQML
participant PanelPopupWindowQML
participant PopupWindowCpp
participant WaylandCompositor
PluginPanel->>PanelPopupQML: change popup.width and popup.height
PanelPopupQML->>PanelPopupWindowQML: Binding requestedWidth = popup.width
PanelPopupQML->>PanelPopupWindowQML: Binding requestedHeight = popup.height
PanelPopupWindowQML->>PanelPopupWindowQML: onRequestedWidthChanged
PanelPopupWindowQML->>PanelPopupWindowQML: onRequestedHeightChanged
PanelPopupWindowQML->>PanelPopupWindowQML: requestUpdateGeometry()
PanelPopupWindowQML->>PanelPopupWindowQML: updateGeometry()
alt invalid requested size (<= 10)
PanelPopupWindowQML->>PanelPopupWindowQML: set width and height to requestedWidth and requestedHeight
else valid requested size
PanelPopupWindowQML->>PanelPopupWindowQML: compute newX and newY within screen bounding
PanelPopupWindowQML->>PopupWindowCpp: setWindowGeometry(newX, newY, requestedWidth, requestedHeight)
PopupWindowCpp->>PopupWindowCpp: setGeometry(px, py, pw, ph)
PopupWindowCpp->>WaylandCompositor: update surface geometry
end
Class diagram for PopupWindow native geometry controlclassDiagram
class QQuickApplicationWindow {
}
class PopupWindow {
+PopupWindow(parent: QWindow)
+setWindowGeometry(px: int, py: int, pw: int, ph: int)
-mouseReleaseEvent(event: QMouseEvent)
}
QQuickApplicationWindow <|-- PopupWindow
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
10sentinel used forrequestedWidth/requestedHeightand the<= 10checks appears in multiple places; consider extracting a named constant or using a more explicit sentinel (e.g., 0 or undefined plus anisValidcheck) to make the intent clearer and avoid magic numbers. - The width/height reset logic in
reset()and the early-return condition inupdateGeometryerboth depend on the same sentinel semantics; it may be cleaner to centralize this reset/initialization behavior in a helper so that the lifecycle of requested vs. actual size is easier to follow and less error-prone.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `10` sentinel used for `requestedWidth`/`requestedHeight` and the `<= 10` checks appears in multiple places; consider extracting a named constant or using a more explicit sentinel (e.g., 0 or undefined plus an `isValid` check) to make the intent clearer and avoid magic numbers.
- The width/height reset logic in `reset()` and the early-return condition in `updateGeometryer` both depend on the same sentinel semantics; it may be cleaner to centralize this reset/initialization behavior in a helper so that the lifecycle of requested vs. actual size is easier to follow and less error-prone.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
dc1e982 to
77f9df4
Compare
…t change Refactored the QML bindings handling the width and height of the popup window. By introducing requestedWidth and requestedHeight and explicitly passing them to the native window bounds via setWindowGeometry, we prevent uncoordinated and recurrent Wayland resize events from corrupting the compositor window geometries during dynamic plugin panel dimension adjustments. 修复:解决因弹出面板尺寸变化导致顶层合成器显示窗口大小异常的缺陷 重构了处理弹出面板宽高的 QML 绑定逻辑。通过引入 requestedWidth 和 requestedHeight 参数,并通过 setWindowGeometry 显式设置底层原 生窗口状态,可以避免在插件动态调整面板尺寸时,高频和未协调的 Wayland 尺寸挂载事件破坏合成器渲染的窗口几何形状。 Log: resolve abnormal compositor window size due to popup panel height change Pms: BUG-307129 BUG-336777
77f9df4 to
587efce
Compare
18202781743
reviewed
Mar 27, 2026
| return | ||
| currentItem = null | ||
| root.requestedWidth = 10 | ||
| root.requestedHeight = 10 |
Contributor
There was a problem hiding this comment.
root.width = 10
root.height = 10
设置宽度的地方是不是应该都去掉,改成root.setWindowGeometry(
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.
…t change
Refactored the QML bindings handling the width and height of the popup window. By introducing requestedWidth and requestedHeight and explicitly passing them to the native window bounds via setWindowGeometry, we prevent uncoordinated and recurrent Wayland resize events from corrupting the compositor window geometries during dynamic plugin panel dimension adjustments.
修复:解决因弹出面板尺寸变化导致顶层合成器显示窗口大小异常的缺陷
重构了处理弹出面板宽高的 QML 绑定逻辑。通过引入 requestedWidth
和 requestedHeight 参数,并通过 setWindowGeometry 显式设置底层原 生窗口状态,可以避免在插件动态调整面板尺寸时,高频和未协调的
Wayland 尺寸挂载事件破坏合成器渲染的窗口几何形状。
Log: resolve abnormal compositor window size due to popup panel height change
Pms: BUG-307129 BUG-336777
Summary by Sourcery
Stabilize popup window geometry updates to prevent compositor window size corruption when popup panel dimensions change.
Bug Fixes:
Enhancements: