aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r--lumina-desktop/panel-plugins/LPPlugin.h4
-rw-r--r--lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp1
-rw-r--r--lumina-desktop/panel-plugins/clock/LClock.cpp1
-rw-r--r--lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp4
-rw-r--r--lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp1
-rw-r--r--lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp1
-rw-r--r--lumina-desktop/panel-plugins/systemstart/LStartButton.cpp1
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp9
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskButton.h2
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp9
-rw-r--r--lumina-desktop/panel-plugins/userbutton/LUserButton.cpp1
11 files changed, 27 insertions, 7 deletions
diff --git a/lumina-desktop/panel-plugins/LPPlugin.h b/lumina-desktop/panel-plugins/LPPlugin.h
index 52df3298..40508522 100644
--- a/lumina-desktop/panel-plugins/LPPlugin.h
+++ b/lumina-desktop/panel-plugins/LPPlugin.h
@@ -68,7 +68,9 @@ public slots:
//This needs to be re-implemented in the subclasses plugin
//This is where any horizontal/vertical orientations can be changed appropriately
}
-
+
+signals:
+ void MenuClosed(); //This needs to be emitted when any plugin's menu is closed for some reason (check/set focus properly)
};
#endif \ No newline at end of file
diff --git a/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp b/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp
index c38c4d3f..c64f934b 100644
--- a/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp
+++ b/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp
@@ -14,6 +14,7 @@ LAppMenuPlugin::LAppMenuPlugin(QWidget *parent, QString id, bool horizontal) : L
button->setAutoRaise(true);
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
button->setMenu( LSession::handle()->applicationMenu() );
+ connect(button->menu(), SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
button->setPopupMode(QToolButton::InstantPopup);
this->layout()->setContentsMargins(0,0,0,0);
this->layout()->addWidget(button);
diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp
index 2c7e3e07..b9f15c49 100644
--- a/lumina-desktop/panel-plugins/clock/LClock.cpp
+++ b/lumina-desktop/panel-plugins/clock/LClock.cpp
@@ -17,6 +17,7 @@ LClock::LClock(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent,
button->setPopupMode(QToolButton::DelayedPopup); //make sure it runs the update routine first
button->setMenu(new QMenu());
connect(button, SIGNAL(clicked()), this, SLOT(openMenu()));
+ connect(button->menu(), SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
calendar = new QCalendarWidget(this);
calAct = new QWidgetAction(this);
calAct->setDefaultWidget(calendar);
diff --git a/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp b/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp
index d95ae2f5..0aa896ce 100644
--- a/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp
+++ b/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp
@@ -60,6 +60,7 @@ void LDeskBarPlugin::initializeDesktop(){
appB->setMenu(appM);
this->layout()->addWidget(appB);
connect(appM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) );
+ connect(appM, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
//Directories on the desktop
dirB = new QToolButton(this);
dirB->setToolButtonStyle(Qt::ToolButtonIconOnly);
@@ -69,6 +70,7 @@ void LDeskBarPlugin::initializeDesktop(){
dirB->setMenu(dirM);
this->layout()->addWidget(dirB);
connect(dirM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) );
+ connect(dirM, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
//Audio Files on the desktop
audioM = new QMenu(this);
connect(audioM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) );
@@ -205,6 +207,7 @@ void LDeskBarPlugin::desktopChanged(){
if(!videoM->isEmpty()){ fileM->addMenu(videoM); }
if(!otherM->isEmpty()){ fileM->addMenu(otherM); }
//Check for a single submenu, and skip the main if need be
+ disconnect(fileB->menu(), SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()) );
if(fileM->actions().length()==1){
if(!audioM->isEmpty()){ fileB->setMenu(audioM); }
else if(!pictureM->isEmpty()){ fileB->setMenu(pictureM); }
@@ -214,6 +217,7 @@ void LDeskBarPlugin::desktopChanged(){
}else{
fileB->setMenu(fileM);
}
+ connect(fileB->menu(), SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
} //end of check for if updates are needed
//Setup the visibility of the buttons
diff --git a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
index a1de725d..95c52d9a 100644
--- a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
+++ b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
@@ -19,6 +19,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal)
label->setToolTip(QString("Workspace 1"));
menu = new QMenu(this);
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuActionTriggered(QAction*)));
+ connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
label->setMenu(menu);
this->layout()->addWidget(label);
diff --git a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp
index 45de0126..267a7cb0 100644
--- a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp
+++ b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp
@@ -18,6 +18,7 @@ LSysDashboard::LSysDashboard(QWidget *parent, QString id, bool horizontal) : LPP
this->layout()->setContentsMargins(0,0,0,0);
this->layout()->addWidget(button);
menu = new QMenu(this);
+ connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
sysmenu = new LSysMenuQuick(this);
connect(sysmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) );
mact = new QWidgetAction(this);
diff --git a/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
index cb43b7c3..673c04ec 100644
--- a/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
+++ b/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
@@ -17,6 +17,7 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon
this->layout()->addWidget(button);
menu = new QMenu(this);
menu->setContentsMargins(1,1,1,1);
+ connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
startmenu = new StartMenu(this);
connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) );
mact = new QWidgetAction(this);
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;
}
}
diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
index 2ee2b494..1fefa304 100644
--- a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
@@ -17,6 +17,7 @@ LUserButtonPlugin::LUserButtonPlugin(QWidget *parent, QString id, bool horizonta
this->layout()->addWidget(button);
menu = new QMenu(this);
menu->setContentsMargins(1,1,1,1);
+ connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed()));
usermenu = new UserWidget(this);
connect(usermenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) );
mact = new QWidgetAction(this);
bgstack15