Skip to content

Commit

Permalink
Fix an issue with tray startup not working
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilXD committed Sep 4, 2022
1 parent c12a691 commit befb755
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1723,14 +1723,8 @@ def __init__(self, twitch: Twitch):
self._handler = _TKOutputHandler(self)
self._handler.setFormatter(FORMATTER)
logging.getLogger("TwitchDrops").addHandler(self._handler)
# stay hidden in tray if needed, otherwise show the window when everything's ready
if self._twitch.settings.tray:
# NOTE: this starts the tray icon thread
self._root.after_idle(self.tray.minimize)
else:
self._root.deiconify()
# gracefully handle Windows shutdown closing the application
if sys.platform == "win32":
# gracefully handle Windows shutdown closing the application
# NOTE: this root.update() is required for the below to work - don't remove
root.update()
self._message_map = {
Expand All @@ -1752,6 +1746,12 @@ def __init__(self, twitch: Twitch):
else:
# use old-style window closing protocol for non-windows platforms
root.protocol("WM_DESTROY_WINDOW", self.close)
# stay hidden in tray if needed, otherwise show the window when everything's ready
if self._twitch.settings.tray:
# NOTE: this starts the tray icon thread
self._root.after_idle(self.tray.minimize)
else:
self._root.deiconify()

# https://stackoverflow.com/questions/56329342/tkinter-treeview-background-tag-not-working
def _fixed_map(self, option):
Expand Down

0 comments on commit befb755

Please sign in to comment.