diff options
Diffstat (limited to 'lumina-desktop/panel-plugins/systemtray')
-rw-r--r-- | lumina-desktop/panel-plugins/systemtray/LSysTray.cpp | 12 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/systemtray/LSysTray.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp index bdd605d0..74705b16 100644 --- a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp +++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp @@ -34,7 +34,7 @@ LSysTray::LSysTray(QWidget *parent, QString id, bool horizontal) : LPPlugin(pare upTimer = new QTimer(this); upTimer->setInterval(300000); //maximum time between refreshes is 5 minutes connect(upTimer, SIGNAL(timeout()), this, SLOT(checkAll()) ); - isRunning = false; stopping = false; checking = false; + isRunning = false; stopping = false; checking = false; pending = false; QTimer::singleShot(100, this, SLOT(start()) ); connect(LSession::handle(), SIGNAL(TrayListChanged()), this, SLOT(checkAll()) ); @@ -88,8 +88,9 @@ void LSysTray::stop(){ // PRIVATE FUNCTIONS // ======================== void LSysTray::checkAll(){ - if(!isRunning || stopping || checking){ return; } //Don't check if not running at the moment + if(!isRunning || stopping || checking){ pending = true; return; } //Don't check if not running at the moment checking = true; + pending = false; //Make sure this tray should handle the windows (was not disabled in the backend) bool TrayRunning = LSession::handle()->registerVisualTray(this->winId()); //qDebug() << "System Tray: Check tray apps"; @@ -156,6 +157,7 @@ void LSysTray::checkAll(){ }*/ //qDebug() << " - System Tray: check done"; checking = false; + if(pending){ QTimer::singleShot(0,this, SLOT(checkAll()) ); } } void LSysTray::UpdateTrayWindow(WId win){ @@ -164,9 +166,11 @@ void LSysTray::UpdateTrayWindow(WId win){ if(trayIcons[i]->appID()==win){ //qDebug() << "System Tray: Update Window " << win; trayIcons[i]->update(); - break; + return; //finished now } - } + } + //Could not find tray in the list, run the checkall routine to make sure we are not missing any + QTimer::singleShot(0,this, SLOT(checkAll()) ); } diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.h b/lumina-desktop/panel-plugins/systemtray/LSysTray.h index 786ca730..2f7872b3 100644 --- a/lumina-desktop/panel-plugins/systemtray/LSysTray.h +++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.h @@ -34,7 +34,7 @@ public: } private: - bool isRunning, stopping, checking; + bool isRunning, stopping, checking, pending; QList<TrayIcon*> trayIcons; QFrame *frame; QBoxLayout *LI; //layout items |