Skip to content

MacOS - Tray Vault Item is Clickable with no Action #1977

Closed

Description

@plasmatech8

Please agree to the following

Summary

The Vault menu item in the tray (with dropdown) is clickable and performs no action except close the tray.

What software is involved?

  • Operating System: MacOS (11.6)
  • Cryptomator: 1.6.4

Volume Type

No response

Steps to Reproduce

  1. Install on Mac
  2. Create a vault
  3. Click on Cryptomator menu bar item
  4. Click on your Vault menu item (the item highlighted)

image

Expected Behavior

Nothing should happen.

A menu item with dropdown/submenu is not usually clickable (it shows the submenu on hover with no click action).

Actual Behavior

The vault menu item is clickable and closes the menu dialog without performing any action.

It can be annoying when you click on you vault menu item and the tray closes without doing any action. (i.e. Accidentally clicked, or intentionally clicked expecting to open the submenu, or intentionally clicked expecting it to unlock the vault)

Reproducibility

Always

Relevant Log Output

No response

Anything else?

I assume that some sort of parameter would need to change in this part of the code in order to make the vault menu item non-clickable.

Activity

  1. added
    good first issue
    on Dec 19, 2021
  2. radon-86 commented on Jul 5, 2023

    @radon-86

    FYI I had a first look at the code base from Cryptomator. I think the problem lies in the SubMenu class because it offers no Runnable like the ActionItem does. In the SubMenu case block should sth. be like this: submenu.addActionListener(evt -> s.action().run());.

  3. overheadhunter commented on Jul 7, 2023

    @overheadhunter
    Member

    Worth a try, but I kind of believe that the item in question being clickable will not improve by adding an action listener. Probably this is just the way, AWT menus (mis)behave on macOS.

  4. radon-86 commented on Aug 2, 2024

    @radon-86

    FYI I had a first look at the code base from Cryptomator. I think the problem lies in the SubMenu class because it offers no Runnable like the ActionItem does. In the SubMenu case block should sth. be like this: submenu.addActionListener(evt -> s.action().run());.

    I am really not sure what I was talking back then. The AWT Menu class and the PopupMenu are the only Menu classes that are implementing the MenuItem. They behave all in that way. I even tried to add an action listener that disables the menu with the method setEnabled. The action is only called when it is clicked. If it's initially set to disable, it's not clickable at any time (and not hoverable and no items are shown). I think you @overheadhunter are right.

    Worth a try, but I kind of believe that the item in question being clickable will not improve by adding an action listener.
    Probably this is just the way, AWT menus (mis)behave on macOS.

  5. oc7o commented on May 17, 2026

    @oc7o

    I would say the bug somewhat lies in src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java but not really 😅
    Vault items are rendered as java.awt.Menu objects.
    MacOS AWT just defines that the tray is dismissed when the submenu item is clicked. This is no bug but this just isn't what we want.

    The only option I see to make it behave as want is by setting an NSMenuDelegate on the underlying NSMenu and returning NO from menu:shouldSelectItem: for items that have a submenu. This prevents click-to-dismiss while still allowing hover-to-expand.

    The problem is getting access to that NSMenu. AWT's internal peer APIs that expose the native pointer were removed in Java 9, so we cannot retrieve the NSMenu from an existing java.awt.PopupMenu. This means we cannot simply patch AwtTrayMenuController.

    The only approach I can imagine that works cleanly is implementing a full MacTrayMenuController in integrations-mac that manages the NSStatusItem and NSMenu natively via AppKit, bypassing AWT entirely. This is roughly 250 lines of Objective-C and reimplements everything AWT was doing for free (tray icon, image loading, menu building, Java callbacks via JNI).

    I'm hesitant to submit this as it is a large, fragile surface area change for what is conceptually a one-line behavioral fix.
    Before going further, I wanted to ask: is there an approach I'm missing, or is a full native TrayMenuController implementation the intended path for this fix?

  6. overheadhunter commented on May 19, 2026

    @overheadhunter
    Member

    @oc7o

    is there an approach I'm missing, or is a full native TrayMenuController implementation the intended path for this fix?

    This is in fact what the "integrations-api" is about: Providing alternative implementations for OS-specific integrations. If there is no other way, use native means.

    If you think you can fix this, go ahead. We can still keep the AWT implementation as a fallback and simply steer which implementation to use via a priority annotation.

    Thanks for taking the initiative!

  7. oc7o commented on May 24, 2026

    @oc7o

    @overheadhunter thx for the reply.

    I finally found the time to push my proposal into this PR: cryptomator/integrations-mac#120

  8. added this to the 1.20.0 milestone on Nov 11, 2026
  9. added a commit that references this issue on Nov 12, 2026
    ec4ca94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueos:mac

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions