mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-08 06:28:27 -04:00
fix(tray): don't dismiss click-opened tray menus from hover controller (#2979)
closeHoverSurfaces() called TrayMenuManager.closeAllMenus(), tearing down every registered tray menu including ones opened by right-click. With hoverPopouts enabled, moving the pointer after a right-click re-ran the hit test and closed the menu before it could be reached. Tag each menu with how it was opened and add closeHoverMenus(), which only closes hover-opened menus. The hover controller now uses that. Click-driven callers pass no argument, so byHover stays undefined and `byHover === true` evaluates to false. Fixes #2978 Claude-Session: https://claude.ai/code/session_01DYF9vdsaToU4Usu7kxPCNB Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,18 @@ Singleton {
|
||||
activeTrayMenus = newMenus
|
||||
}
|
||||
|
||||
function closeHoverMenus() {
|
||||
for (const screenName in activeTrayMenus) {
|
||||
const menu = activeTrayMenus[screenName]
|
||||
if (!menu || menu.openedByHover !== true) continue
|
||||
if (typeof menu.close === "function") {
|
||||
menu.close()
|
||||
} else if (menu.showMenu !== undefined) {
|
||||
menu.showMenu = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closeAllMenus() {
|
||||
for (const screenName in activeTrayMenus) {
|
||||
const menu = activeTrayMenus[screenName]
|
||||
|
||||
Reference in New Issue
Block a user