fix(tray): don't dismiss click-opened tray menus from the hover controller - #2979
Open
nofuturekid wants to merge 1 commit into
Open
fix(tray): don't dismiss click-opened tray menus from the hover controller#2979nofuturekid wants to merge 1 commit into
nofuturekid wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2978
Problem
DankBarHoverController.closeHoverSurfaces()callsTrayMenuManager.closeAllMenus(), which tears down every registered tray menu — including ones opened by right-click. WithhoverPopoutsenabled, moving the pointer after a right-click reaches that call through one of the two sites that skip thecursorOverHoverChain()guard, and the menu is gone before it can be used.Approach
TrayMenuManagercould not tell a hover-opened menu from a click-opened one — both go through the sameshowForTrayItem(). This tags the menu with how it was opened and adds a narrowercloseHoverMenus()for the hover controller.closeAllMenus()is untouched.Click-driven callers pass no argument, so
byHoverstaysundefinedandbyHover === trueisfalse— 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 withhoverPopouts: true,hoverPopoutDelay: 350:closeAllMenus()call produced the same result, isolating it as the cause.Not verified: the
openedByHover === truepath. 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-git0.3.0.r19.g43d4fa9-1, Niri, single output, Arch Linux.