Repository navigation
fix(dock): prevent overflow popup closing on app context menu [cherry-pick] - #1913
Conversation
1. Add a contextMenuGuard callback to AppItem to signal context menu state 2. Notify TaskOverflowButton when an app context menu opens or hides 3. Use the guard flag to keep the overflow popup open while a menu is active Log: Keep the task overflow popup open when an app context menu is shown Influence: Prevents overflow popup from closing unexpectedly on right- click fix(dock): 修复右键菜单导致任务溢出弹窗关闭 1. 为 AppItem 增加 contextMenuGuard 回调以传递右键菜单状态 2. 应用右键菜单显示或隐藏时通知 TaskOverflowButton 3. 使用该标志避免菜单激活期间关闭溢出弹窗 Log: 避免应用右键菜单显示时任务溢出弹窗被意外关闭 Influence: 防止右键操作时溢出弹窗意外关闭 PMS: BUG-384793 (cherry picked from commit 2f8526c)
Reviewer's GuideUITrack app context-menu visibility from overflow delegates and use it to keep the task overflow popup open until the menu closes.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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="panels/dock/taskmanager/package/AppItem.qml" line_range="605" />
<code_context>
function requestAppItemMenu() {
+ if (root.contextMenuGuard)
+ root.contextMenuGuard(true)
if (!root.preservePanelPopupOnContextMenu) {
Panel.requestClosePopup()
</code_context>
<issue_to_address>
**Overflow popup stays open**
When a folder in the overflow popup opens its context menu, `requestAppItemMenu()` sets the guard before opening the folder menu, but that menu does not use `contextMenuLoader`'s hide handler. The guard remains active after the folder menu closes, so `closeOnInactive` stays false and the overflow popup does not close when the user clicks away.
Clear the guard when the folder context menu hides.
Also at `panels/dock/taskmanager/package/AppItem.qml:508-511`, `panels/dock/taskmanager/package/AppItem.qml:604`.
</issue_to_address>
### Comment 2
<location path="panels/dock/taskmanager/package/AppItem.qml" line_range="509" />
<code_context>
sourceComponent: LP.Menu {
id: contextMenu
+ onAboutToHide: Qt.callLater(function() {
+ if (MenuHelper.activeMenu === null && root.contextMenuGuard)
+ root.contextMenuGuard(false)
+ })
</code_context>
<issue_to_address>
**Overflow popup stays open**
When another menu replaces an overflow app's context menu before the deferred hide callback runs, the deferred `onAboutToHide` handler sees a non-null `MenuHelper.activeMenu` and skips clearing the guard. The replacement menu has no handler to clear it when it closes, so the overflow popup stays open when the user clicks away.
Ensure the guard is cleared when the replacement menu closes instead of skipping the reset while `MenuHelper.activeMenu` is non-null.
Also at `panels/dock/taskmanager/package/TaskOverflowButton.qml:228`.
</issue_to_address>|
|
||
| function requestAppItemMenu() { | ||
| if (root.contextMenuGuard) | ||
| root.contextMenuGuard(true) |
There was a problem hiding this comment.
🟡 Medium · Overflow popup stays open
When a folder in the overflow popup opens its context menu, requestAppItemMenu() sets the guard before opening the folder menu, but that menu does not use contextMenuLoader's hide handler. The guard remains active after the folder menu closes, so closeOnInactive stays false and the overflow popup does not close when the user clicks away.
Clear the guard when the folder context menu hides.
Also at panels/dock/taskmanager/package/AppItem.qml:508-511, panels/dock/taskmanager/package/AppItem.qml:604.
Prompt for AI agents
In `panels/dock/taskmanager/package/AppItem.qml` at line 605:
**Overflow popup stays open**
When a folder in the overflow popup opens its context menu, `requestAppItemMenu()` sets the guard before opening the folder menu, but that menu does not use `contextMenuLoader`'s hide handler. The guard remains active after the folder menu closes, so `closeOnInactive` stays false and the overflow popup does not close when the user clicks away.
Clear the guard when the folder context menu hides.
Also at `panels/dock/taskmanager/package/AppItem.qml:508-511`, `panels/dock/taskmanager/package/AppItem.qml:604`.| sourceComponent: LP.Menu { | ||
| id: contextMenu | ||
| onAboutToHide: Qt.callLater(function() { | ||
| if (MenuHelper.activeMenu === null && root.contextMenuGuard) |
There was a problem hiding this comment.
🟡 Medium · Overflow popup stays open
When another menu replaces an overflow app's context menu before the deferred hide callback runs, the deferred onAboutToHide handler sees a non-null MenuHelper.activeMenu and skips clearing the guard. The replacement menu has no handler to clear it when it closes, so the overflow popup stays open when the user clicks away.
Ensure the guard is cleared when the replacement menu closes instead of skipping the reset while MenuHelper.activeMenu is non-null.
Also at panels/dock/taskmanager/package/TaskOverflowButton.qml:228.
Prompt for AI agents
In `panels/dock/taskmanager/package/AppItem.qml` at line 509:
**Overflow popup stays open**
When another menu replaces an overflow app's context menu before the deferred hide callback runs, the deferred `onAboutToHide` handler sees a non-null `MenuHelper.activeMenu` and skips clearing the guard. The replacement menu has no handler to clear it when it closes, so the overflow popup stays open when the user clicks away.
Ensure the guard is cleared when the replacement menu closes instead of skipping the reset while `MenuHelper.activeMenu` is non-null.
Also at `panels/dock/taskmanager/package/TaskOverflowButton.qml:228`.|
[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 |
|
将 #1912 回移到
develop/2500u3,修复在任务栏溢出弹窗内右键点击应用时,溢出弹窗意外关闭的问题。PMS: BUG-384793
回移无冲突,已核对补丁与原提交
2f8526c4一致,git diff --check通过。Summary by Sourcery
Bug Fixes: