Merge pull request #1204 from weslly/fix/unlock-dialog-focus

Focus database unlock dialog on macOS
This commit is contained in:
Weslly 2017-11-20 10:59:44 -02:00 committed by GitHub
commit a953db6d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -256,6 +256,13 @@ void AutoType::resetInAutoType()
m_inAutoType = false;
}
void AutoType::raiseWindow()
{
#if defined(Q_OS_MAC)
m_plugin->raiseOwnWindow();
#endif
}
void AutoType::unloadPlugin()
{
if (m_executor) {

View File

@ -51,6 +51,7 @@ public:
public slots:
void performGlobalAutoType(const QList<Database*>& dbList);
void raiseWindow();
signals:
void globalShortcutTriggered();

View File

@ -1400,6 +1400,12 @@ void DatabaseWidget::showUnlockDialog()
{
m_unlockDatabaseDialog->clearForms();
m_unlockDatabaseDialog->setDBFilename(m_filename);
#if defined(Q_OS_MAC)
autoType()->raiseWindow();
Tools::wait(500);
#endif
m_unlockDatabaseDialog->show();
m_unlockDatabaseDialog->activateWindow();
}