-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clicking the Tribler icon on Ubuntu 22 doesn't do anything (running from source) #8084
Comments
This might be https://github.com/moses-palmer/pystray/issues/ 20 It could also be this:
|
To confirm: >>> pystray.Icon.HAS_MENU
False |
I added a quick workaround to make a press function like a click on "Open" in the menu. diff --git a/src/run_tribler.py b/src/run_tribler.py
index 9200e6eb7..02209fe6d 100644
--- a/src/run_tribler.py
+++ b/src/run_tribler.py
@@ -92,6 +92,14 @@ async def main() -> None:
menu = (pystray.MenuItem('Open', lambda: webbrowser.open_new_tab(url)),
pystray.MenuItem('Quit', lambda: session.shutdown_event.set()))
icon = pystray.Icon("Tribler", icon=image, title="Tribler", menu=menu)
+
+ import Xlib
+ old_dispatch = icon._message_handlers[Xlib.X.ButtonPress]
+ def dispatch_press(event):
+ old_dispatch(event)
+ webbrowser.open_new_tab(url)
+ icon._message_handlers[Xlib.X.ButtonPress] = dispatch_press
+
threading.Thread(target=icon.run).start()
await session.shutdown_event.wait() |
Ideally, you'd want to use the |
I just tried: I still don't get a menu. I printed I figured I could force the matter using Then I installed |
At least the build works. I guess I'll downgrade this from a bug to a feature request, a "nice to have" for when I run from source. |
I think that fixing #8085 offers a workable workaround for this. The only downside then is that closing the browser tab will make you "lose" Tribler and you'll have to manually invoke the GUI with the API key. However, when running from source, the Tribler process should be available from your terminal anyway to restore/kill. |
On Ubuntu 22.04.4 LTS the Tribler icon shows up but clicking (right or left) the icon does not show a context menu to open the browser.
The text was updated successfully, but these errors were encountered: