moses-palmer/pystray

Calbacks not working on tint2

1942-ZaidHaider-Cedcommerce opened this issue · 6 comments

OS: linux mint 19.3
Openbox, with tint2 dock containing the system tray

clicking does nothing, right clicking shows the default openbox menu.

Im not sure if its an issue with tint2 or pystray, other tray icons are working fine though.
thanks in advance

Thank you for your report.

What backend do you use? A simple print of an I con instance should reveal this.

I manually tried all supported back-ends, none worked except xorg. (I dont have gtk dependencies installed)

<pystray._xorg.Icon object at 0x7f70509e0ca0>

PS. sorry for the late reply.

Have you tried setting a default action? As documented, the Xorg backend does not support a menu.

def click(icon, item):
    print('hi')


icon = pystray.Icon(name="the_chat", icon=image, title="TheChat", menu=pystray.Menu(
    pystray.MenuItem(text="Left-Click-Action",
                     action=click, default=True),

This is the code I am using . This does nothing on clicking the icon

Edit: 12-Oct-2023
I have tested the same code on another pc with unaltered gnome, it works fine. Issue is tint2 specific

The Xorg backend is also not working on Linux Mint 20 mate.
appindicator backend works fine.

The XOrg backend is very minimal, as implementing a menu would be a very large task.