moses-palmer / pystray

GNU General Public License v3.0
461 stars 57 forks source link

Calbacks not working on tint2 #151

Closed 1942-ZaidHaider-Cedcommerce closed 4 months ago

1942-ZaidHaider-Cedcommerce commented 9 months ago

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

moses-palmer commented 9 months ago

Thank you for your report.

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

1942-ZaidHaider-Cedcommerce commented 9 months ago

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.

moses-palmer commented 9 months ago

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

1942-ZaidHaider-Cedcommerce commented 9 months ago
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

1942-ZaidHaider-Cedcommerce commented 8 months ago

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

moses-palmer commented 4 months ago

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