From befb7552734487950b9cef5045277df072001398 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sun, 4 Sep 2022 09:30:19 +0200 Subject: [PATCH] Fix an issue with tray startup not working --- gui.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gui.py b/gui.py index c029b15..974bebc 100644 --- a/gui.py +++ b/gui.py @@ -1723,14 +1723,8 @@ class GUIManager: 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 = { @@ -1752,6 +1746,12 @@ class GUIManager: 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):