Use icon.visible to show or hide the tray icon on all systems

On Linux, pystray's icon.stop() currently doesn't work well with the
AppIndicator backend.

So, instead of destroying the icon when the user restores from tray
(only to later re-create it when the user minimizes to tray again), we
have the option to control the icon's visibility instead! Luckily, that
works on Windows too!

Note that for this change to work properly on Linux, we need to switch
to the master version of pystray, because we need this specific fix:

https://github.com/moses-palmer/pystray/commit/5943ed4e19be48224cf39b70444de8ffe22c23ce

After pystray releases a version newer than 0.19.4, we can switch back.

Co-authored-by: DevilXD <bartosz.peszek@gmail.com>
This commit is contained in:
guihkxandDevilXD authored and DevilXD committed 2023-06-11 16:58:18 +02:00
1 parent 7a07e1a9e4
commit f8c0dba1ee
2 files changed
+26 -25

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
aiohttp>2.0,<4.0
Pillow
pystray
# TODO: switch back to a stable pystray release when a version newer than v0.19.4 is out
pystray@git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992
# selenium-wire
# undetected-chromedriver
# this is installed only on windows