macOS: Check for Auto-Type permissions on use instead of at launch

* Fix #3689 - link the use of Auto-Type with the permissions required to use it
This commit is contained in:
Jonathan White
2019-11-03 23:00:03 -05:00
committed by Janek Bevendorff
parent 440331d319
commit 7ba9fcc0e5
7 changed files with 76 additions and 14 deletions

View File

@@ -218,6 +218,15 @@ void AutoType::executeAutoTypeActions(const Entry* entry, QWidget* hideWindow, c
if (hideWindow) {
#if defined(Q_OS_MACOS)
// Check for accessibility permission
if (!macUtils()->enableAccessibility()) {
MessageBox::information(nullptr,
tr("Permission Required"),
tr("KeePassXC requires the Accessibility permission in order to perform entry "
"level Auto-Type. If you already granted permission, you may have to restart "
"KeePassXC."));
return;
}
macUtils()->raiseLastActiveWindow();
m_plugin->hideOwnWindow();
#else