Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 7cf86634d0988e620f069324ff701db1 > files > 2

kvirc-4.0.2-2.fc14.src.rpm

Index: src/modules/trayicon/libkvitrayicon.cpp
===================================================================
--- src/modules/trayicon/libkvitrayicon.cpp	(revision 4751)
+++ src/modules/trayicon/libkvitrayicon.cpp	(revision 4752)
@@ -413,9 +413,24 @@
 
 void KviTrayIcon::activatedSlot( QSystemTrayIcon::ActivationReason reason )
 {
-	if(reason==QSystemTrayIcon::Trigger && (KVI_OPTION_BOOL(KviOption_boolCloseInTray) || !m_pFrm->isVisible()))
+	switch(reason)
 	{
-		toggleParentFrame();
+		case QSystemTrayIcon::Trigger:
+			// This is single click
+#ifdef COMPILE_ON_MAC
+			// On MacOSX one can only single-left-click the icon.
+			// This activates the context menu and is quite confusing if it *also* hides the kvirc window.
+			// So on mac we only _show_ the main window if it's hidden and the CloseInTray option is enabled.
+			if(KVI_OPTION_BOOL(KviOption_boolCloseInTray) && ((!m_pFrm->isVisible()) || m_pFrm->isMinimized()))
+				toggleParentFrame();
+#else //!COMPILE_ON_MAC
+			// on other platforms we always toggle the window
+			toggleParentFrame();
+#endif //!COMPILE_ON_MAC
+		break;
+		default:
+			// we do nothing at this time
+		break;
 	}
 }