Fix hiding main window after browser unlock request

* The main window doesn't hide properly during unlock sequence if it is in the background (ie, not minimized and not hidden to tray). This change makes sure the window hides after interaction on all platforms.
This commit is contained in:
Jonathan White 2021-08-29 15:31:09 -04:00
parent 53dcafaa58
commit 0450bf3487

View File

@ -814,11 +814,8 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
} }
} }
#ifdef Q_OS_MAC
// Re-hide the application if it wasn't visible before // Re-hide the application if it wasn't visible before
// only affects macOS because dialogs force the main window to show
hideWindow(); hideWindow();
#endif
m_dialogActive = false; m_dialogActive = false;
@ -1306,12 +1303,10 @@ void BrowserService::databaseLocked(DatabaseWidget* dbWidget)
void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget) void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget)
{ {
if (dbWidget) { if (dbWidget) {
#ifdef Q_OS_MAC
if (m_bringToFrontRequested) { if (m_bringToFrontRequested) {
m_bringToFrontRequested = false; m_bringToFrontRequested = false;
hideWindow(); hideWindow();
} }
#endif
QJsonObject msg; QJsonObject msg;
msg["action"] = QString("database-unlocked"); msg["action"] = QString("database-unlocked");