From cc0d25c123a3006dbd481dde6ecf51d455e91487 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 4 Dec 2016 20:07:27 +0530 Subject: [PATCH] Fix a regression in 2.72 that broke the --start-in-tray command line option. Fixes #1644876 [calibre --start-in-tray does not work anymore on Win10](https://bugs.launchpad.net/calibre/+bug/1644876) --- src/calibre/gui2/ui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index e3abdf441f..b16f96d893 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -84,6 +84,7 @@ class Listener(Thread): # {{{ # }}} + _gui = None @@ -348,8 +349,6 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ LibraryViewMixin.init_library_view_mixin(self, db) SearchBoxMixin.init_search_box_mixin(self) # Requires current_db - if self.system_tray_icon is not None and self.system_tray_icon.isVisible() and opts.start_in_tray: - self.hide_windows() self.library_view.model().count_changed_signal.connect( self.iactions['Choose Library'].count_changed) if not gprefs.get('quick_start_guide_added', False): @@ -423,6 +422,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ # Note this has to come after restoreGeometry() because of # https://bugreports.qt.io/browse/QTBUG-56831 self.show() + if self.system_tray_icon is not None and self.system_tray_icon.isVisible() and opts.start_in_tray: + self.hide_windows() self.auto_adder = AutoAdder(gprefs['auto_add_path'], self) self.save_layout_state()