diff options
Diffstat (limited to 'lumina-desktop/panel-plugins/taskmanager')
3 files changed, 14 insertions, 6 deletions
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index eda1f2cd..01105c97 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -25,6 +25,8 @@ LTaskButton::LTaskButton(QWidget *parent, bool smallDisplay) : LTBWidget(parent) connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()) ); connect(winMenu, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(openActionMenu()) ); connect(winMenu, SIGNAL(triggered(QAction*)), this, SLOT(winClicked(QAction*)) ); + connect(winMenu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); + connect(actMenu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); } LTaskButton::~LTaskButton(){ @@ -107,10 +109,13 @@ void LTaskButton::UpdateButton(){ QAction *tmp = winMenu->addAction( WINLIST[i].icon(junk), WINLIST[i].text() ); tmp->setData(i); //save which number in the WINLIST this entry is for LXCB::WINDOWSTATE stat = WINLIST[i].status(true); //update the saved state for the window - if(stat==LXCB::ATTENTION){ showstate = stat; } //highest priority + if(stat<LXCB::ACTIVE && WINLIST[i].windowID() == LSession::handle()->activeWindow()){ stat = LXCB::ACTIVE; } + if(stat > showstate){ showstate = stat; } //higher priority + + /*if(stat==LXCB::ATTENTION){ showstate = stat; } //highest priority else if( stat==LXCB::ACTIVE && showstate != LXCB::ATTENTION){ showstate = stat; } //next priority else if( stat==LXCB::VISIBLE && showstate != LXCB::ATTENTION && showstate != LXCB::ACTIVE){ showstate = stat; } - else if(showstate == LXCB::INVISIBLE || showstate == LXCB::IGNORE){ showstate = stat; } //anything is the same/better + else if(showstate == LXCB::INVISIBLE || showstate == LXCB::IGNORE){ showstate = stat; } //anything is the same/better*/ } //Now setup the button appropriately // - visibility diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h index b980071e..c26492e4 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h @@ -64,5 +64,7 @@ private slots: void winClicked(QAction*); void openActionMenu(); +signals: + void MenuClosed(); }; #endif diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp index 79a164b8..be3e665a 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp @@ -35,8 +35,8 @@ void LTaskManagerPlugin::UpdateButtons(){ //Get the current window list QList<WId> winlist = LSession::handle()->XCB->WindowList(); //Do not change the status of the previously active window if it just changed to a non-visible window - WId activeWin = LSession::handle()->XCB->ActiveWindow(); - bool skipActive = !winlist.contains(activeWin); + //WId activeWin = LSession::handle()->XCB->ActiveWindow(); + //bool skipActive = !winlist.contains(activeWin); //qDebug() << "Update Buttons:" << winlist; if(updating > ctime){ return; } //another thread kicked off already - stop this one //Now go through all the current buttons first @@ -74,9 +74,9 @@ void LTaskManagerPlugin::UpdateButtons(){ if(!updated){ //qDebug() << "Update Button:" << i; if(updating > ctime){ return; } //another thread kicked off already - stop this one - if(!skipActive || !BUTTONS[i]->isActive()){ + //if(!skipActive || !BUTTONS[i]->isActive()){ QTimer::singleShot(1,BUTTONS[i], SLOT(UpdateButton()) ); //keep moving on - } + //} } } //Now go through the remaining windows @@ -108,6 +108,7 @@ void LTaskManagerPlugin::UpdateButtons(){ but->setIconSize(QSize(this->width(), this->width())); } this->layout()->addWidget(but); + connect(but, SIGNAL(MenuClosed()), this, SIGNAL(MenuClosed())); BUTTONS << but; } } |