Package: krusader / 2:2.5.0-2

FIXED-365105-Workaround-for-bug-in-KF5-QSystemTrayIcon.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Alexander Bikadorov <alex.bikadorov@kdemail.net>
Date: Fri, 28 Oct 2016 19:07:53 +0200
Subject: FIXED: [ 365105 ] Workaround for bug in KF5+QSystemTrayIcon

BUG: 365105
---
 krusader/krusader.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/krusader/krusader.cpp b/krusader/krusader.cpp
index 01a4533f..da153f4d 100644
--- a/krusader/krusader.cpp
+++ b/krusader/krusader.cpp
@@ -366,6 +366,21 @@ void Krusader::changeEvent(QEvent *event) {
         if(isMinimized()) {
             KConfigGroup group(krConfig, "Look&Feel");
             if (group.readEntry("Minimize To Tray", _MinimizeToTray)) {
+                // TODO tray created again to prevent bug in kf5,
+                // remove this if bug 365105 is resolved
+                sysTray->deleteLater();
+                sysTray = new QSystemTrayIcon(this);
+                sysTray->setIcon(krLoader->loadIcon(privIcon(), KIconLoader::Panel, 22));
+                QMenu *trayMenu = new QMenu(this);
+                trayMenu->addSection(QGuiApplication::applicationDisplayName()); // show "title"
+                QAction *restoreAction = new QAction(i18n("Restore"), this);
+                connect(restoreAction, SIGNAL(triggered()), SLOT(showFromTray()));
+                trayMenu->addAction(restoreAction);
+                trayMenu->addSeparator();
+                trayMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Quit)));
+                sysTray->setContextMenu(trayMenu);
+                connect(sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(showFromTray()));
+
                 sysTray->show();
                 hide();
             }