Skip to content

feat(tray): left/right click behavior#729

Open
alexandre-abrioux wants to merge 1 commit intoMalpenZibo:mainfrom
alexandre-abrioux:tray-click
Open

feat(tray): left/right click behavior#729
alexandre-abrioux wants to merge 1 commit intoMalpenZibo:mainfrom
alexandre-abrioux:tray-click

Conversation

@alexandre-abrioux
Copy link
Copy Markdown
Contributor

@alexandre-abrioux alexandre-abrioux commented May 5, 2026

Closes #492

Change description

This PR adds support for configuring the left- and right-click behavior for tray items. We can now either:

  • show the context menu (like before)
  • open the application (new)

To consider

⚠️ I took the liberty of changing the default for left-clicking tray items. It now opens the application instead of opening the context menu. The context menu is now bound to right-click by default.

I felt it was an OK change to make because:

  • Left-clicking workspace icons already switches the workspace, and so switching to an app with left-clicking tray icons feels similar.
  • Context menus often open on right-click.
  • I've introduced new config properties so users can specify their preference.
  • The documentation includes an example on how to switch the buttons.

However, I understand this is mostly subjective and likely a matter of personal preference. I'm happy to revert that part. Please let me know if you consider this unwanted and would like to revert the default left-click behavior to its previous state.

@MalpenZibo
Copy link
Copy Markdown
Owner

I'm not sure about this change.

The default config behavior should remain the old one. Left-clicking the icon opens the menu. The problem with opening the app is more about the scope of the module. This is a tray module and not a Docker bar. I do not expect to be able to open an application from there directly, maybe only from some tray menu option if present.

Anyway, it's a minimal change, so we could also include it. Not sure about the configuration, in this way it's possible to set both clicks on the same action, which doesn't make much sense. We could place a simple bool to invert the action.

  • field not present or false -> left click open the menu, right open the app
  • field true -> left click open the app, right open the menu

@alexandre-abrioux
Copy link
Copy Markdown
Contributor Author

@MalpenZibo Thanks for the review 🙏

To keep the exact behavior we have today, what do you think about extending the enum with a third values: none. The default config would be:

[tray]
left_click = "menu"
right_click = "none"

Users could configure the following if they want:

[tray]
left_click = "open"
right_click = "menu"

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.

Tray Click Behaviour

2 participants