feat(tray): add IPC action to open tray menus#2701
Open
lankong0522 wants to merge 1 commit into
Open
Conversation
This comment was marked as spam.
This comment was marked as spam.
bbedward
requested changes
Jun 29, 2026
|
|
||
| signal openTrayMenuRequested(string itemId) | ||
|
|
||
| function requestOpenTrayMenu(itemId) { |
Collaborator
There was a problem hiding this comment.
Let's remove this function, its useless
| target: TrayMenuManager | ||
|
|
||
| function onOpenTrayMenuRequested(itemId) { | ||
| const item = root.allTrayItems.find(trayItem => { |
Collaborator
There was a problem hiding this comment.
Move findTrayItem to TrayMenuManager instead of duplicating the logic
bbedward
reviewed
Jun 29, 2026
| if (!item || !item.hasMenu) | ||
| return; | ||
|
|
||
| TrayMenuManager.closeAllMenus(); |
Collaborator
There was a problem hiding this comment.
Not needed, already handled by showForTrayItem
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.
Summary
This adds a new tray IPC action:
The new action opens the menu for a system tray item using the same item lookup behavior as the existing tray IPC actions.
Implementation
openTrayMenuRequestedsignal toTrayMenuManager.menu(itemId)function to the tray IPC handler.SystemTrayBarby reusing the existingshowForTrayItem()path.The IPC layer only requests the menu to be opened. It does not attempt to render or display tray menus directly.
Motivation
This makes it possible to open tray item menus from compositor keybindings, for example from niri shortcuts, without manually clicking the tray item in the bar.
Tested
Tested with a separate Quickshell test config: