diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-17 10:31:51 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-17 10:31:51 -0400 |
commit | c816fad1b4462b979d7b60c4e510fab3896a6bf1 (patch) | |
tree | 29cbcbd76fb3c5563db6a01929248423534eab99 /src-qt5/core | |
parent | Oops - forgot to save the fallback CPU temperature reading into the variable. (diff) | |
download | lumina-c816fad1b4462b979d7b60c4e510fab3896a6bf1.tar.gz lumina-c816fad1b4462b979d7b60c4e510fab3896a6bf1.tar.bz2 lumina-c816fad1b4462b979d7b60c4e510fab3896a6bf1.zip |
Fix the painting routines for the desktop/panel. Make sure we only paint the *requested* rectangle, and not the whole thing on every request.
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | 5 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LPanel.cpp | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp index 3d33db71..97249384 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -7,12 +7,13 @@ #include "LDesktopBackground.h" #include <QPainter> +#include <QPaintEvent> -void LDesktopBackground::paintEvent(QPaintEvent *) { +void LDesktopBackground::paintEvent(QPaintEvent *ev) { if (bgPixmap != NULL) { QPainter painter(this); painter.setBrush(*bgPixmap); - painter.drawRect(0, 0, width(), height()); + painter.drawRect(ev->rect()); } } diff --git a/src-qt5/core/lumina-desktop/LPanel.cpp b/src-qt5/core/lumina-desktop/LPanel.cpp index b0abf498..6e07f624 100644 --- a/src-qt5/core/lumina-desktop/LPanel.cpp +++ b/src-qt5/core/lumina-desktop/LPanel.cpp @@ -324,12 +324,12 @@ void LPanel::paintEvent(QPaintEvent *event){ QPainter *painter = new QPainter(this); //qDebug() << "Paint Panel:" << PPREFIX; //Make sure the base background of the event rectangle is the associated rectangle from the BGWindow - QRect rec = this->geometry(); //start with the global geometry of the panel + QRect rec = event->rect();//this->geometry(); //start with the global geometry of the panel //Need to translate that rectangle to the background image coordinates - //qDebug() << " - Rec:" << rec << hidden << this->geometry(); - rec.moveTo( rec.x()-LSession::handle()->screenGeom(screennum).x(), rec.y()-LSession::handle()->screenGeom(screennum).y() ); - //qDebug() << " - Adjusted Global Rec:" << rec; - painter->drawPixmap(QRect(0,0,this->width(), this->height()), bgWindow->grab(rec) ); + qDebug() << " - Rec:" << rec << hidden << this->geometry() << bgWindow->geometry(); + rec.moveTo( bgWindow->mapFromGlobal( this->mapToGlobal(rec.topLeft()) ) ); //(rec.x()-LSession::handle()->screenGeom(screennum).x(), rec.y()-LSession::handle()->screenGeom(screennum).y() ); + qDebug() << " - Adjusted Window Rec:" << rec; + painter->drawPixmap(event->rect(), bgWindow->grab(rec) ); } QWidget::paintEvent(event); //now pass the event along to the normal painting event } |