Repository navigation
feat(tray): add IPC action to open tray menus - #2701
Conversation
This comment was marked as spam.
This comment was marked as spam.
|
|
||
| signal openTrayMenuRequested(string itemId) | ||
|
|
||
| function requestOpenTrayMenu(itemId) { |
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 => { |
There was a problem hiding this comment.
Move findTrayItem to TrayMenuManager instead of duplicating the logic
| if (!item || !item.hasMenu) | ||
| return; | ||
|
|
||
| TrayMenuManager.closeAllMenus(); |
There was a problem hiding this comment.
Not needed, already handled by showForTrayItem
|
@lankong0522 following up here to see if we should close this out as stale or if you plan on the follow up on requested changes. |
Thanks for following up. I plan to continue working on this PR and address the requested changes. I will rebase the branch onto the latest master, apply the review feedback, retest the feature, and update this PR. |
cae971d to
dc1b2b3
Compare
|
Updated and rebased onto the latest Addressed all requested review changes:
I tested the updated implementation locally using the current source tree. The existing |
* feat(tray): add IPC action to open tray menus * tray: open IPC-requested menus on the focused screen only --------- Co-authored-by: bbedward <[email protected]>
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
Built and launched the current source tree with:
Verified the tray IPC actions using the locally built binary:
Confirmed that valid tray menus open correctly, existing tray IPC actions continue to work, and missing tray items return the expected error.