You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pystray tray icon does not appear on Mac. This happens both when running from source and when running from the build. I uncovered that the following line is to blame:
Only on Mac, icon.run() cannot be run on anything other than the main thread.
BUT if you do run icon.run() on the main thread, it blocks the main thread until the application exits. The run_detached function exists but this doesn't work without extra effort. In particular, we need to run an event loop or, rather, something that consumes and runs events on the main Python thread.
I made a proof-of-concept of an asyncio-compatible consuming "event loop" (the meat is in runEventLoop and main is essentially our run_tribler.py with two changed lines):
The
pystray
tray icon does not appear on Mac. This happens both when running from source and when running from the build. I uncovered that the following line is to blame:tribler/src/run_tribler.py
Line 197 in 35cc11e
Only on Mac,
icon.run()
cannot be run on anything other than the main thread.BUT if you do run
icon.run()
on the main thread, it blocks the main thread until the application exits. Therun_detached
function exists but this doesn't work without extra effort. In particular, we need to run an event loop or, rather, something that consumes and runs events on the main Python thread.I made a proof-of-concept of an asyncio-compatible consuming "event loop" (the meat is in
runEventLoop
andmain
is essentially ourrun_tribler.py
with two changed lines):We may want to beautify this a bit.
The text was updated successfully, but these errors were encountered: