diff options
Diffstat (limited to 'lumina-desktop/panel-plugins/taskmanager')
4 files changed, 32 insertions, 15 deletions
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index 79981754..53ab3a09 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -33,22 +33,26 @@ LTaskButton::~LTaskButton(){ //=========== // PUBLIC //=========== -QList<LWinInfo> LTaskButton::windows(){ - return WINLIST; +QList<WId> LTaskButton::windows(){ + QList<WId> list; + for(int i=0; i<WINLIST.length(); i++){ + list << WINLIST[i].windowID(); + } + return list; } QString LTaskButton::classname(){ return cname; } -void LTaskButton::addWindow(LWinInfo win){ - WINLIST << win; +void LTaskButton::addWindow(WId win){ + WINLIST << LWinInfo(win); UpdateButton(); } -void LTaskButton::rmWindow(LWinInfo win){ +void LTaskButton::rmWindow(WId win){ for(int i=0; i<WINLIST.length(); i++){ - if(WINLIST[i].windowID() == win.windowID()){ + if(WINLIST[i].windowID() == win){ WINLIST.removeAt(i); break; } @@ -158,6 +162,7 @@ void LTaskButton::maximizeWindow(){ if(winMenu->isVisible()){ winMenu->hide(); } LWinInfo win = currentWindow(); LSession::handle()->XCB->MaximizeWindow(win.windowID()); + //LSession::handle()->adjustWindowGeom(win.windowID(), true); //run this for now until the WM works properly cWin = LWinInfo(); //clear the current } diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h index 3202d676..8ee60b01 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h @@ -31,12 +31,12 @@ public: ~LTaskButton(); //Window Information - QList<LWinInfo> windows(); + QList<WId> windows(); QString classname(); //Window Management - void addWindow(LWinInfo win); //Add a window to this button - void rmWindow(LWinInfo win); //Remove a window from this button + void addWindow(WId win); //Add a window to this button + void rmWindow(WId win); //Remove a window from this button private: QList<LWinInfo> WINLIST; diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp index ccad7531..67378c68 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp @@ -14,7 +14,8 @@ LTaskManagerPlugin::LTaskManagerPlugin(QWidget *parent, QString id, bool horizon connect(timer, SIGNAL(timeout()), this, SLOT(UpdateButtons()) ); usegroups = true; //backwards-compatible default value if(id.contains("-nogroups")){ usegroups = false; } - connect(LSession::instance(), SIGNAL(WindowListEvent()), this, SLOT(checkWindows()) ); + connect(LSession::handle(), SIGNAL(WindowListEvent()), this, SLOT(checkWindows()) ); + connect(LSession::handle(), SIGNAL(WindowListEvent(WId)), this, SLOT(UpdateButton(WId)) ); this->layout()->setContentsMargins(0,0,0,0); QTimer::singleShot(0,this, SLOT(UpdateButtons()) ); //perform an initial sync //QTimer::singleShot(100,this, SLOT(OrientationChange()) ); //perform an initial sync @@ -38,15 +39,15 @@ void LTaskManagerPlugin::UpdateButtons(){ //Now go through all the current buttons first for(int i=0; i<BUTTONS.length(); i++){ //Get the windows managed in this button - QList<LWinInfo> WI = BUTTONS[i]->windows(); + QList<WId> WI = BUTTONS[i]->windows(); bool updated=false; if(updating > ctime){ return; } //another thread kicked off already - stop this one //Loop over all the windows for this button for(int w=0; w<WI.length(); w++){ if(updating > ctime){ return; } //another thread kicked off already - stop this one - if( winlist.contains( WI[w].windowID() ) ){ + if( winlist.contains( WI[w] ) ){ //Still current window - update it later - winlist.removeAll(WI[w].windowID()); //remove this window from the list since it is done + winlist.removeAll(WI[w] ); //remove this window from the list since it is done }else{ //Window was closed - remove it if(WI.length()==1){ @@ -95,7 +96,7 @@ void LTaskManagerPlugin::UpdateButtons(){ //No group, create a new button //qDebug() << "New Button"; LTaskButton *but = new LTaskButton(this, usegroups); - but->addWindow( LWinInfo(winlist[i]) ); + but->addWindow( winlist[i] ); if(this->layout()->direction()==QBoxLayout::LeftToRight){ but->setIconSize(QSize(this->height(), this->height())); }else{ @@ -107,6 +108,16 @@ void LTaskManagerPlugin::UpdateButtons(){ } } +void LTaskManagerPlugin::UpdateButton(WId win){ + for(int i=0; i<BUTTONS.length(); i++){ + if(BUTTONS[i]->windows().contains(win)){ + qDebug() << "Update Task Manager Button (single window ping)"; + QTimer::singleShot(0,BUTTONS[i], SLOT(UpdateButton()) ); + break; + } + } +} + void LTaskManagerPlugin::checkWindows(){ timer->start(); -}
\ No newline at end of file +} diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h index 6aebcb17..e6371f34 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h @@ -38,6 +38,7 @@ private: private slots: void UpdateButtons(); + void UpdateButton(WId win); void checkWindows(); public slots: |