aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/systemtray
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-12-18 07:47:48 -0500
committerKen Moore <ken@pcbsd.org>2014-12-18 07:47:48 -0500
commit71c2fda95224f0a04316c5f1059628d33564ca43 (patch)
treeca74dbe49dd2f555e73893e7f5f06154d6dab763 /lumina-desktop/panel-plugins/systemtray
parentOops, forgot to add knowledge of the new "Wine" app category to the userbutton. (diff)
downloadlumina-71c2fda95224f0a04316c5f1059628d33564ca43.tar.gz
lumina-71c2fda95224f0a04316c5f1059628d33564ca43.tar.bz2
lumina-71c2fda95224f0a04316c5f1059628d33564ca43.zip
Commit a checkpoint on the conversion of Lumina to Qt5.
It is functional at the moment, but still has a few rough edges with regards to the X11 background interface (due to the move from XLib to XCB in Qt5). This reulst in some of the window manager interactions not behaving properly (such as sticky status on panels).
Diffstat (limited to 'lumina-desktop/panel-plugins/systemtray')
-rw-r--r--lumina-desktop/panel-plugins/systemtray/LSysTray.cpp14
-rw-r--r--lumina-desktop/panel-plugins/systemtray/LSysTray.h2
-rw-r--r--lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp22
3 files changed, 26 insertions, 12 deletions
diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
index dacb7b55..1eafffee 100644
--- a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
+++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
@@ -53,7 +53,7 @@ void LSysTray::start(){
isRunning = LSession::handle()->registerVisualTray(this->winId());
qDebug() << "Visual Tray Started:" << this->type() << isRunning;
if(isRunning){
- upTimer->start();
+ //upTimer->start();
QTimer::singleShot(0,this, SLOT(checkAll()) );
}
//Make sure we catch all events right away
@@ -169,6 +169,7 @@ void LSysTray::checkAll(){
if(!isRunning || stopping || checking){ return; } //Don't check if not running at the moment
checking = true;
//qDebug() << "System Tray: Check tray apps";
+ bool listChanged = false;
QList<WId> wins = LSession::handle()->currentTrayApps(this->winId());
for(int i=0; i<trayIcons.length(); i++){
int index = wins.indexOf(trayIcons[i]->appID());
@@ -179,6 +180,7 @@ void LSysTray::checkAll(){
LI->removeWidget(cont);
delete cont;
i--; //List size changed
+ listChanged = true;
//Re-adjust the maximum widget size to account for what is left
if(this->layout()->direction()==QBoxLayout::LeftToRight){
this->setMaximumSize( trayIcons.length()*this->height(), 10000);
@@ -217,9 +219,17 @@ void LSysTray::checkAll(){
LI->removeWidget(cont);
delete cont;
continue;
- }
+ }else{
+ listChanged = true;
+ }
LI->update(); //make sure there is no blank space in the layout
}
+ /*if(listChanged){
+ //Icons got moved around: be sure to re-draw all of them to fix visuals
+ for(int i=0; i<trayIcons.length(); i++){
+ trayIcons[i]->update();
+ }
+ }*/
//qDebug() << " - System Tray: check done";
checking = false;
}
diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.h b/lumina-desktop/panel-plugins/systemtray/LSysTray.h
index f45a52ad..1b482ef7 100644
--- a/lumina-desktop/panel-plugins/systemtray/LSysTray.h
+++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.h
@@ -12,7 +12,7 @@
#include <QHBoxLayout>
#include <QDebug>
#include <QX11Info>
-#include <QX11EmbedContainer>
+//#include <QX11EmbedContainer>
#include <QCoreApplication>
//Local includes
diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
index 64c7c77d..716a49ed 100644
--- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
+++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
@@ -6,11 +6,13 @@
//===========================================
#include "TrayIcon.h"
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
+//#include <X11/Xlib.h>
+//#include <X11/Xutil.h>
#include <X11/extensions/Xdamage.h>
-static Damage dmgID = 0;
+//#include <xcb/damage.h>
+//static xcb_damage_damage_t dmgID;
+static int dmgID = 0;
TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){
AID = 0; //nothing yet
@@ -36,10 +38,10 @@ void TrayIcon::attachApp(WId id){
if( LX11::EmbedWindow(AID, IID) ){
LX11::RestoreWindow(AID); //make it visible
//XSelectInput(QX11Info::display(), AID, StructureNotifyMask);
+ //xcb_damage_create(QX11Info::connection(), dmgID, AID, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
dmgID = XDamageCreate( QX11Info::display(), AID, XDamageReportRawRectangles );
- updateIcon();
qDebug() << "New System Tray App:" << AID;
- QTimer::singleShot(500, this, SLOT(updateIcon()) );
+ QTimer::singleShot(1000, this, SLOT(updateIcon()) );
}else{
qWarning() << "Could not Embed Tray Application:" << AID;
//LX11::DestroyWindow(IID);
@@ -64,9 +66,9 @@ void TrayIcon::detachApp(){
//Now detach the application window and clean up
qDebug() << " - Unembed";
LX11::UnembedWindow(tmp);
- if(dmgID!=0){
- XDamageDestroy(QX11Info::display(), dmgID);
- }
+ //if(dmgID!=0){
+ //XDamageDestroy(QX11Info::display(), dmgID);
+ //}
qDebug() << " - finished app:" << tmp;
//if(IID!=this->winId()){ LX11::DestroyWindow(IID); }
IID = 0;
@@ -98,6 +100,7 @@ void TrayIcon::updateIcon(){
//Make sure the icon is square
QSize icosize = this->size();
LX11::ResizeWindow(AID, icosize.width(), icosize.height());
+ QTimer::singleShot(500, this, SLOT(update()) ); //make sure to re-draw the window in a moment
}
// =============
@@ -115,7 +118,7 @@ void TrayIcon::paintEvent(QPaintEvent *event){
QPixmap pix = LX11::WindowImage(AID, false);
if(pix.isNull()){
//Try to grab the window directly with Qt
- //qDebug() << " - - Grab window directly";
+ qDebug() << " - - Grab window directly";
pix = QPixmap::grabWindow(AID);
}
//qDebug() << " - Pix size:" << pix.size().width() << pix.size().height();
@@ -138,6 +141,7 @@ void TrayIcon::resizeEvent(QResizeEvent *event){
//qDebug() << "Resize Event:" << event->size().width() << event->size().height();
if(AID!=0){
LX11::ResizeWindow(AID, event->size().width(), event->size().height());
+ QTimer::singleShot(500, this, SLOT(update()) ); //make sure to re-draw the window in a moment
}
}
bgstack15