From 70a4878fbbd2565ca89adb56ac274c04c42f2934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 11 Jul 2009 16:33:51 +0000 Subject: [PATCH] Do not calculate window mask from svg when compositing is active as it's not needed and speeds up resizing. And correctly paint themes not providing an opaque element (which they should provide for the window mask) when compositing is not active. svn path=/trunk/KDE/kdebase/workspace/; revision=994961 --- clients/aurorae/src/aurorae.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 536cc0a208..b8d7bc4ba3 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -661,10 +661,16 @@ void AuroraeClient::paintEvent(QPaintEvent *event) } QRectF sourceRect = rect; if (!compositingActive()) { - rect = QRectF(conf.paddingLeft(), conf.paddingTop(), - widget()->width()-conf.paddingRight()-conf.paddingLeft(), - widget()->height()-conf.paddingBottom()-conf.paddingTop()); - sourceRect = QRectF(0.0, 0.0, rect.width(), rect.height()); + if (frame->hasElementPrefix("decoration-opaque")) { + rect = QRectF(conf.paddingLeft(), conf.paddingTop(), + widget()->width()-conf.paddingRight()-conf.paddingLeft(), + widget()->height()-conf.paddingBottom()-conf.paddingTop()); + sourceRect = QRectF(0.0, 0.0, rect.width(), rect.height()); + } + else { + rect = QRectF(conf.paddingLeft(), conf.paddingTop(), widget()->width(), widget()->height()); + sourceRect = rect; + } } frame->resizeFrame(rect.size()); frame->paintFrame(&painter, rect, sourceRect); @@ -685,7 +691,7 @@ void AuroraeClient::updateWindowShape() int w=widget()->width(); int h=widget()->height(); - if (maximized) { + if (maximized || compositingActive()) { QRegion mask(0,0,w,h); setMask(mask); return; @@ -695,7 +701,9 @@ void AuroraeClient::updateWindowShape() Plasma::FrameSvg *deco = AuroraeFactory::instance()->frame(); if (!deco->hasElementPrefix("decoration-opaque")) { // opaque element is missing: set generic mask - QRegion mask(0,0,w,h); + w = w - conf.paddingLeft() - conf.paddingRight(); + h = h - conf.paddingTop() - conf.paddingBottom(); + QRegion mask(conf.paddingLeft(),conf.paddingTop(),w,h); setMask(mask); return; }