Repository navigation
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
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Reviewer's GuideUITrack app context-menu open and hide events through the guard callback, and use that state to keep the overflow popup open until the menu is inactive.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 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="604" />
<code_context>
}
function requestAppItemMenu() {
+ if (root.contextMenuGuard)
+ root.contextMenuGuard(true)
if (!root.preservePanelPopupOnContextMenu) {
</code_context>
<issue_to_address>
**Folder menus leave overflow open**
When a folder app in the overflow popup has its context menu dismissed, `requestAppItemMenu()` sets the guard and opens `FolderContextMenu` instead of the `contextMenuLoader` menu, whose hide callback clears the guard. `contextMenuActive` therefore remains true, `closeOnInactive` stays false, and the overflow popup remains open.
Clear the guard when `FolderContextMenu` closes, using the same reset behavior as the loader menu.
Also at `panels/dock/taskmanager/package/AppItem.qml:509`, `panels/dock/taskmanager/package/AppItem.qml:605`.
</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>
**Replacement menus leave overflow open**
When another `MenuHelper` menu replaces an app context menu before the deferred hide callback runs, the deferred handler skips clearing the guard while the replacement menu is active, and that menu does not clear this AppItem's guard when it closes. `contextMenuActive` stays true, so `closeOnInactive` remains false and the overflow popup does not close on deactivation or outside clicks.
Keep the guard active while a replacement menu is open, then clear it when that menu closes.
</issue_to_address>
### Comment 3
<location path="panels/dock/taskmanager/package/TaskOverflowButton.qml" line_range="228" />
<code_context>
popupX: DockPanelPositioner.x
popupY: DockPanelPositioner.y
- closeOnInactive: MenuHelper.activeMenu === null && !Panel.contextDragging
+ closeOnInactive: !root.contextMenuActive
+ && MenuHelper.activeMenu === null && !Panel.contextDragging
</code_context>
<issue_to_address>
**Popup closes during focus handoff**
When the context menu closes while the overflow popup has not yet regained window activation, `closeOnInactive` becomes true as soon as the context-menu hide callback clears the guard. If the overflow window is still inactive while the window system is handing focus back from the menu, `PanelPopup`'s deferred inactive check closes it before focus returns, so dismissing the menu also closes the overflow popup.
Avoid re-enabling inactive closing until focus restoration has completed, or make the deferred close check account for the pending focus handoff.
</issue_to_address>| } | ||
|
|
||
| function requestAppItemMenu() { | ||
| if (root.contextMenuGuard) |
There was a problem hiding this comment.
🟡 Medium · Folder menus leave overflow open
When a folder app in the overflow popup has its context menu dismissed, requestAppItemMenu() sets the guard and opens FolderContextMenu instead of the contextMenuLoader menu, whose hide callback clears the guard. contextMenuActive therefore remains true, closeOnInactive stays false, and the overflow popup remains open.
Clear the guard when FolderContextMenu closes, using the same reset behavior as the loader menu.
Also at panels/dock/taskmanager/package/AppItem.qml:509, panels/dock/taskmanager/package/AppItem.qml:605.
Prompt for AI agents
In `panels/dock/taskmanager/package/AppItem.qml` at line 604:
**Folder menus leave overflow open**
When a folder app in the overflow popup has its context menu dismissed, `requestAppItemMenu()` sets the guard and opens `FolderContextMenu` instead of the `contextMenuLoader` menu, whose hide callback clears the guard. `contextMenuActive` therefore remains true, `closeOnInactive` stays false, and the overflow popup remains open.
Clear the guard when `FolderContextMenu` closes, using the same reset behavior as the loader menu.
Also at `panels/dock/taskmanager/package/AppItem.qml:509`, `panels/dock/taskmanager/package/AppItem.qml:605`.| sourceComponent: LP.Menu { | ||
| id: contextMenu | ||
| onAboutToHide: Qt.callLater(function() { | ||
| if (MenuHelper.activeMenu === null && root.contextMenuGuard) |
There was a problem hiding this comment.
🟡 Medium · Replacement menus leave overflow open
When another MenuHelper menu replaces an app context menu before the deferred hide callback runs, the deferred handler skips clearing the guard while the replacement menu is active, and that menu does not clear this AppItem's guard when it closes. contextMenuActive stays true, so closeOnInactive remains false and the overflow popup does not close on deactivation or outside clicks.
Keep the guard active while a replacement menu is open, then clear it when that menu closes.
Prompt for AI agents
In `panels/dock/taskmanager/package/AppItem.qml` at line 509:
**Replacement menus leave overflow open**
When another `MenuHelper` menu replaces an app context menu before the deferred hide callback runs, the deferred handler skips clearing the guard while the replacement menu is active, and that menu does not clear this AppItem's guard when it closes. `contextMenuActive` stays true, so `closeOnInactive` remains false and the overflow popup does not close on deactivation or outside clicks.
Keep the guard active while a replacement menu is open, then clear it when that menu closes.| popupX: DockPanelPositioner.x | ||
| popupY: DockPanelPositioner.y | ||
| closeOnInactive: MenuHelper.activeMenu === null && !Panel.contextDragging | ||
| closeOnInactive: !root.contextMenuActive |
There was a problem hiding this comment.
🟡 Medium · Popup closes during focus handoff
When the context menu closes while the overflow popup has not yet regained window activation, closeOnInactive becomes true as soon as the context-menu hide callback clears the guard. If the overflow window is still inactive while the window system is handing focus back from the menu, PanelPopup's deferred inactive check closes it before focus returns, so dismissing the menu also closes the overflow popup.
Avoid re-enabling inactive closing until focus restoration has completed, or make the deferred close check account for the pending focus handoff.
Prompt for AI agents
In `panels/dock/taskmanager/package/TaskOverflowButton.qml` at line 228:
**Popup closes during focus handoff**
When the context menu closes while the overflow popup has not yet regained window activation, `closeOnInactive` becomes true as soon as the context-menu hide callback clears the guard. If the overflow window is still inactive while the window system is handing focus back from the menu, `PanelPopup`'s deferred inactive check closes it before focus returns, so dismissing the menu also closes the overflow popup.
Avoid re-enabling inactive closing until focus restoration has completed, or make the deferred close check account for the pending focus handoff.
|
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): 修复右键菜单导致任务溢出弹窗关闭
Log: 避免应用右键菜单显示时任务溢出弹窗被意外关闭
Influence: 防止右键操作时溢出弹窗意外关闭
PMS: BUG-384793
Summary by Sourcery
Bug Fixes: