summaryrefslogtreecommitdiff
blob: b8c618be0c2ce109463be451d3117b0892740295 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From d2e34218068432ba9c312591067e53eda67cb68a Mon Sep 17 00:00:00 2001
From: Dominik Haumann <dhaumann@kde.org>
Date: Wed, 12 Jun 2013 22:30:32 +0200
Subject: [PATCH] fix crash in passive notification system

@packagers / distributions: Better backport this to you 4.10.4 packages.

FIXED-IN: 4.10.5
BUG: 320302
---
 part/view/katemessagewidget.cpp | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/part/view/katemessagewidget.cpp b/part/view/katemessagewidget.cpp
index d3c895f..6c227c0 100644
--- a/part/view/katemessagewidget.cpp
+++ b/part/view/katemessagewidget.cpp
@@ -225,11 +225,28 @@ void KateMessageWidget::startAutoHideTimer()
     return;
   }
 
+  // switching KateViews may result isVisible() == true and still m_messageList.size() == 0.
+  // The problem is that the hideEvent is never called for the KMessageWidget, if the
+  // parent widget is hidden. In that case, we 'miss' that the notification is gone...
+  if (m_messageList.size() == 0) {
+    m_hideAnimationRunning = false;
+    m_autoHideTimerRunning = false;
+    m_autoHideTime = -1;
+
+    if (isVisible()) {
+      m_hideAnimationRunning = true;
+      if (m_fadeEffect) {
+        m_fadeEffect->fadeOut();
+      } else {
+        m_messageWidget->animatedHide();
+      }
+    }
+    return;
+  }
+
   // remember that auto hide timer is running
   m_autoHideTimerRunning = true;
 
-  // the message must still still be valid
-  Q_ASSERT(m_messageList.size());
   KTextEditor::Message* message = m_messageList[0];
   QTimer::singleShot(m_autoHideTime == 0 ? (6*1000) : m_autoHideTime, message, SLOT(deleteLater()));
 }
-- 
1.8.2.1