From 5f0cc490e2cfda140da65ae8ee369e2e6418a3ab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Oct 2014 16:17:50 +0530 Subject: [PATCH] System tray icon: On windows if the calibre window is minimized, fix clicking on the system tray icon not restoring the window. Fixes #1387596 [windows systray-icon behaviour](https://bugs.launchpad.net/calibre/+bug/1387596) --- src/calibre/gui2/ui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 89787bf960..a96c8965fd 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -498,9 +498,14 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ def system_tray_icon_activated(self, r=False): if r in (QSystemTrayIcon.Trigger, QSystemTrayIcon.MiddleClick, False): if self.isVisible(): - self.hide_windows() + if self.isMinimized(): + self.showNormal() + else: + self.hide_windows() else: self.show_windows() + if self.isMinimized(): + self.showNormal() @property def is_minimized_to_tray(self):