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.
This commit is contained in:
parent
6750f8907e
commit
044ffb3a4b
2 changed files with 7 additions and 0 deletions
|
@ -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<EffectsHandlerImpl*>(effects)->provides(Effect::Outline)) {
|
||||
static_cast<EffectsHandlerImpl*>(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<EffectsHandlerImpl*>(effects)->provides(Effect::Outline)) {
|
||||
static_cast<EffectsHandlerImpl*>(effects)->slotHideOutline();
|
||||
return; // done by effect
|
||||
|
|
|
@ -96,6 +96,7 @@ private:
|
|||
Window m_leftOutline;
|
||||
QRect m_outlineGeometry;
|
||||
bool m_initialized;
|
||||
bool m_active;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue