Repository navigation
fix(dock): prevent overflow popup closing on app context menu [cherry-pick] #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ Item { | |
| property bool enableTitle: false | ||
| property bool titleActive: enableTitle && titleLoader.active | ||
| property bool preservePanelPopupOnContextMenu: false | ||
| property var contextMenuGuard: null | ||
| property bool updateIconGeometry: true | ||
| property Item previewAnchor: icon | ||
| // Folder content replaces the overflow popup, so anchor it to the dock. | ||
|
|
@@ -504,6 +505,10 @@ Item { | |
| property bool trashEmpty: true | ||
| sourceComponent: LP.Menu { | ||
| id: contextMenu | ||
| onAboutToHide: Qt.callLater(function() { | ||
| if (MenuHelper.activeMenu === null && root.contextMenuGuard) | ||
| root.contextMenuGuard(false) | ||
| }) | ||
| Instantiator { | ||
| id: menuItemInstantiator | ||
| model: JSON.parse(menus) | ||
|
|
@@ -596,6 +601,8 @@ Item { | |
| } | ||
|
|
||
| function requestAppItemMenu() { | ||
| if (root.contextMenuGuard) | ||
| root.contextMenuGuard(true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Overflow popup stays open When a folder in the overflow popup opens its context menu, Clear the guard when the folder context menu hides. Also at Prompt for AI agentsIn `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`. |
||
| if (!root.preservePanelPopupOnContextMenu) { | ||
| Panel.requestClosePopup() | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · Overflow popup stays open
When another menu replaces an overflow app's context menu before the deferred hide callback runs, the deferred
onAboutToHidehandler sees a non-nullMenuHelper.activeMenuand 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.activeMenuis non-null.Also at
panels/dock/taskmanager/package/TaskOverflowButton.qml:228.Prompt for AI agents