From 0f6f1f428c9f7e5ee12ee7648f13980f11dc42c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Wed, 2 Sep 2009 15:54:49 +0200
Subject: [PATCH] Fixed painting glitch visible on Windows

Creator would get darker and darker when dragging or clicking the mouse.
Don't paint the editor indicator when there is no view or the view has
editors.

Reviewed-by: mae
Reviewed-by: Daniel Molkentin
---
 src/plugins/coreplugin/editormanager/editormanager.cpp | 2 --
 src/plugins/coreplugin/editormanager/editorview.cpp    | 9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 12a31c7e988..dd7b7d18365 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -554,13 +554,11 @@ IEditor *EditorManager::currentEditor() const
     return m_d->m_currentEditor;
 }
 
-
 void EditorManager::emptyView(Core::Internal::EditorView *view)
 {
     if (!view)
         return;
 
-
     QList<IEditor *> editors = view->editors();
     foreach (IEditor *editor, editors) {
         if (!m_d->m_editorModel->isDuplicate(editor)) {
diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp
index ea9b2ff1648..6a69fc24204 100644
--- a/src/plugins/coreplugin/editormanager/editorview.cpp
+++ b/src/plugins/coreplugin/editormanager/editorview.cpp
@@ -650,11 +650,14 @@ void SplitterOrView::mousePressEvent(QMouseEvent *e)
 
 void SplitterOrView::paintEvent(QPaintEvent *)
 {
-    if  (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this)
+    if (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this)
+        return;
+
+    if (!m_view || hasEditors())
         return;
-    QPainter painter(this);
 
-    // Discreet indication where an editor would be
+    // Discreet indication where an editor would be if there is none
+    QPainter painter(this);
     painter.setRenderHint(QPainter::Antialiasing, true);
     painter.setPen(Qt::NoPen);
     QColor shadeBrush(Qt::black);
-- 
GitLab