aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/systemtray
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-24 08:01:29 -0400
committerKen Moore <ken@pcbsd.org>2015-03-24 08:01:29 -0400
commit120207ea7de7ca6e0973ececb4787e982feefcd1 (patch)
tree3c7dcdf0c2d182f25e5caf1531e13948376c7cd0 /lumina-desktop/panel-plugins/systemtray
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
parentAdd a new information file: DeveloperGuidelines.txt (diff)
downloadlumina-120207ea7de7ca6e0973ececb4787e982feefcd1.tar.gz
lumina-120207ea7de7ca6e0973ececb4787e982feefcd1.tar.bz2
lumina-120207ea7de7ca6e0973ececb4787e982feefcd1.zip
Merge branch 'master' of github.com:pcbsd/lumina
Diffstat (limited to 'lumina-desktop/panel-plugins/systemtray')
-rw-r--r--lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
index 7e0a30f6..e966f389 100644
--- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
+++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
@@ -12,6 +12,10 @@
//#include <xcb/damage.h>
//static xcb_damage_damage_t dmgID;
+
+#include <LSession.h>
+#include <QScreen>
+
static int dmgID = 0;
TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){
@@ -115,17 +119,23 @@ void TrayIcon::paintEvent(QPaintEvent *event){
//qDebug() << " - Draw tray:" << AID << IID << this->winId();
//qDebug() << " - - " << event->rect().x() << event->rect().y() << event->rect().width() << event->rect().height();
//qDebug() << " - Get image:" << AID;
- QPixmap pix = LX11::WindowImage(AID, false);
+ QPixmap pix = LSession::handle()->XCB->WindowImage(AID);
if(pix.isNull()){
//Try to grab the window directly with Qt
qDebug() << " - - Grab window directly";
- pix = QPixmap::grabWindow(AID);
+ QList<QScreen*> scrnlist = QApplication::screens();
+ for(int i=0; i<scrnlist.length(); i++){
+ pix = scrnlist[i]->grabWindow(AID);
+ break; //stop here
+ }
}
//qDebug() << " - Pix size:" << pix.size().width() << pix.size().height();
//qDebug() << " - Geom:" << this->geometry().x() << this->geometry().y() << this->geometry().width() << this->geometry().height();
if(!pix.isNull()){
if(this->size() != pix.size()){ QTimer::singleShot(10, this, SLOT(updateIcon())); qDebug() << "-- Icon size mismatch"; }
painter.drawPixmap(0,0,this->width(), this->height(), pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
+ }else{
+ qDebug() << " - - No Tray Icon/Image found!" << "ID:" << AID;
}
//qDebug() << " - Done";
}
bgstack15