Skip to content

fix(tray): don't dismiss click-opened tray menus from the hover controller - #2979

Open
nofuturekid wants to merge 1 commit into
AvengeMedia:masterfrom
nofuturekid:fix/tray-menu-hover-dismiss
Open

fix(tray): don't dismiss click-opened tray menus from the hover controller#2979
nofuturekid wants to merge 1 commit into
AvengeMedia:masterfrom
nofuturekid:fix/tray-menu-hover-dismiss

Conversation

@nofuturekid

@nofuturekid nofuturekid commented Aug 1, 2026

Copy link
Copy Markdown

Fixes #2978

Problem

DankBarHoverController.closeHoverSurfaces() calls TrayMenuManager.closeAllMenus(), which tears down every registered tray menu — including ones opened by right-click. With hoverPopouts enabled, moving the pointer after a right-click reaches that call through one of the two sites that skip the cursorOverHoverChain() guard, and the menu is gone before it can be used.

Approach

TrayMenuManager could not tell a hover-opened menu from a click-opened one — both go through the same showForTrayItem(). This tags the menu with how it was opened and adds a narrower closeHoverMenus() for the hover controller. closeAllMenus() is untouched.

Click-driven callers pass no argument, so byHover stays undefined and byHover === true is false — no changes needed there. +19/-5 across three files.

Adding the guard to the two unguarded call sites instead would also stop the symptom, but that check returns true whenever any tray menu is registered, so hover-opened ones would stop being dismissed too.

Testing

Against the running shell via DMS_SHELL_DIR, on Niri with hoverPopouts: true, hoverPopoutDelay: 350:

  • Right-click menu stays open while the pointer travels to it, entries selectable — previously it closed on the first movement.
  • Hover popouts on bar widgets unchanged.
  • Commenting out the closeAllMenus() call produced the same result, isolating it as the cause.

Not verified: the openedByHover === true path. Tray icons never open on hover here — see #2978 for why — so it rests on reading the code, not a measurement.

Environment

DMS ef191ba, quickshell-git 0.3.0.r19.g43d4fa9-1, Niri, single output, Arch Linux.

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 AvengeMedia#2978

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DYF9vdsaToU4Usu7kxPCNB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right-click tray context menus are dismissed by the bar hover controller when hoverPopouts is enabled

1 participant