From 28e4a199c06ee3c819b22424d488c6b295901556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 14 Aug 2009 11:16:02 +0000 Subject: [PATCH] Restrict painting of the svg to the decoration. No need to paint behind the window as it isn't visible anyway. That seems to fix the most painfull performance issues with Aurorae. svn path=/trunk/KDE/kdebase/workspace/; revision=1011338 --- clients/aurorae/src/aurorae.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 33ea0db579..0885976900 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -685,6 +685,27 @@ void AuroraeClient::paintEvent(QPaintEvent *event) } } + // restrict painting on the decoration - no need to paint behind the window + int left, right, top, bottom; + decoration()->borders(left, right, top, bottom); + painter.setClipping(true); + painter.setClipRect(0, 0, + left + conf.paddingLeft(), + height() + conf.paddingTop() + conf.paddingBottom(), + Qt::ReplaceClip); + painter.setClipRect(0, 0, + width() + conf.paddingLeft() + conf.paddingRight(), + top + conf.paddingTop(), + Qt::UniteClip); + painter.setClipRect(width() - right + conf.paddingLeft(), 0, + right + conf.paddingRight(), + height() + conf.paddingTop() + conf.paddingBottom(), + Qt::UniteClip); + painter.setClipRect(0, height() - bottom + conf.paddingTop(), + width() + conf.paddingLeft() + conf.paddingRight(), + bottom + conf.paddingBottom(), + Qt::UniteClip); + // top if (maximized) { frame->setEnabledBorders(Plasma::FrameSvg::NoBorder);