Lower the main window after unlock request from extension (#1884)

This commit is contained in:
Sami Vänttinen 2018-05-05 00:31:17 +03:00 committed by Jonathan White
parent 635d6fe82c
commit 963ac75389
2 changed files with 8 additions and 1 deletions

View File

@ -47,7 +47,8 @@ static int KEEPASSXCBROWSER_DEFAULT_ICON = 1;
BrowserService::BrowserService(DatabaseTabWidget* parent) :
m_dbTabWidget(parent),
m_dialogActive(false)
m_dialogActive(false),
m_bringToFrontRequested(false)
{
connect(m_dbTabWidget, SIGNAL(databaseLocked(DatabaseWidget*)), this, SLOT(databaseLocked(DatabaseWidget*)));
connect(m_dbTabWidget, SIGNAL(databaseUnlocked(DatabaseWidget*)), this, SLOT(databaseUnlocked(DatabaseWidget*)));
@ -82,6 +83,7 @@ bool BrowserService::openDatabase(bool triggerUnlock)
if (triggerUnlock) {
KEEPASSXC_MAIN_WINDOW->bringToFront();
m_bringToFrontRequested = true;
}
return false;
@ -743,6 +745,10 @@ void BrowserService::databaseLocked(DatabaseWidget* dbWidget)
void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget)
{
if (dbWidget) {
if (m_bringToFrontRequested) {
KEEPASSXC_MAIN_WINDOW->lower();
m_bringToFrontRequested = false;
}
emit databaseUnlocked();
}
}

View File

@ -78,6 +78,7 @@ private:
private:
DatabaseTabWidget* const m_dbTabWidget;
bool m_dialogActive;
bool m_bringToFrontRequested;
};
#endif // BROWSERSERVICE_H