From 044ffb3a4b6d7ff92e50d4df4bb8d9643c895794 Mon Sep 17 00:00:00 2001 From: Philipp Knechtges Date: Tue, 31 Jan 2012 14:34:04 +0100 Subject: [PATCH] kwin: fix Outline::hide() bug Unless the mouse pointer is not next to an electric border kwin calls Outline::hide() on every move/resize event. To avoid unnecessary repaints we now check whether the outline has been visible or not. --- outline.cpp | 6 ++++++ outline.h | 1 + 2 files changed, 7 insertions(+) diff --git a/outline.cpp b/outline.cpp index 6ef499ce26..7819eba969 100644 --- a/outline.cpp +++ b/outline.cpp @@ -29,6 +29,7 @@ namespace KWin { Outline::Outline() : m_initialized(false) + , m_active(false) { } @@ -44,6 +45,7 @@ Outline::~Outline() void Outline::show() { + m_active = true; if (effects && static_cast(effects)->provides(Effect::Outline)) { static_cast(effects)->slotShowOutline(m_outlineGeometry); return; // done by effect @@ -53,6 +55,10 @@ void Outline::show() void Outline::hide() { + if (!m_active) { + return; + } + m_active = false; if (effects && static_cast(effects)->provides(Effect::Outline)) { static_cast(effects)->slotHideOutline(); return; // done by effect diff --git a/outline.h b/outline.h index 6eddaece42..20e7a8668b 100644 --- a/outline.h +++ b/outline.h @@ -96,6 +96,7 @@ private: Window m_leftOutline; QRect m_outlineGeometry; bool m_initialized; + bool m_active; }; }