I experimented with implementing the Activate method, it gets called when left-clicking the status icon. But there is nothing to activate when Activate is called. AppIndicator has a "menu" reference, but "menu" can not be activated, only MenuItem. AppIndicator itself can not be activated as well. (Or nobody listens for that signals)
The half-assed workaround Electron is doing is to create a dummy MenuItem, with label set the same as the status icon tooltip and add a "click-action-item" flag. https://github.com/electron/electron/blob/8532e1239ec929e31b764ffcd314c8db3e09a19f/shell/browser/ui/gtk/app_indicator_icon_menu.cc#L65 But this item never gets actually added to the Menu, as HasClickAction always returns false. https://github.com/electron/electron/blob/8532e1239ec929e31b764ffcd314c8db3e09a19f/shell/browser/ui/tray_icon_gtk.cc#L64 Note: "SecondaryActivate" is only called on middle-button click. On right click, the menu is open directly, without any method called on the AppIndicator DBus. On left click, the "Activate" method is called if it exists. (at least in KDE Plasma 5.24.6) -- You received this bug notification because you are a member of DX Packages, which is subscribed to libappindicator in Ubuntu. Matching subscriptions: dx-packages https://bugs.launchpad.net/bugs/1910521 Title: libappindicator breaks left-mouse actions for most applications Status in libappindicator package in Ubuntu: Confirmed Bug description: Hello, because GTK will drop tray icon support in version 4, many projects switch to libappindicator instead. Some are network-manager-applet, blueman-tray and electron (affecting all electron apps). The latter 2 automatically use libappindicator if it's available in the system. For most applications, with libappindicator the tray icon behavior is broken (at least on archlinux with xfce4 and libappindicator-gtk3): * left mouse button triggers the context menu rather than the left-mouse-button action * the context menu is located beneath the mouse button, so when the mouse is released, the action is performed (in most cases "exit application"). Since the web is full of issue reports about this, I'm, pretty sure it's an issue in libappindicator itself than in every single application that uses it. IMO this is a critical issue, especially for a library that provides tray support to applications. Kind regards, Michael. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1910521/+subscriptions -- Mailing list: https://launchpad.net/~dx-packages Post to : dx-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~dx-packages More help : https://help.launchpad.net/ListHelp