From 71085838db9122a7dcdd08752c2fa28f2fcb8cd5 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 17 Oct 2019 21:48:08 -0400 Subject: [PATCH] Make macOS Auto-Type more robust * Fix #3351 On macOS, entry specific Auto-Type (Cmd+Shift+V) now raises the last active window before lowering the KeePassXC window. This improves accuracy of the window that is actually typed into. --- src/autotype/AutoType.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 1868d5260..a539d0a03 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -37,6 +37,10 @@ #include "core/Tools.h" #include "gui/MessageBox.h" +#ifdef Q_OS_MAC +#include "gui/macutils/MacUtils.h" +#endif + AutoType* AutoType::m_instance = nullptr; AutoType::AutoType(QObject* parent, bool test) @@ -214,6 +218,7 @@ void AutoType::executeAutoTypeActions(const Entry* entry, QWidget* hideWindow, c if (hideWindow) { #if defined(Q_OS_MACOS) + macUtils()->raiseLastActiveWindow(); m_plugin->hideOwnWindow(); #else hideWindow->showMinimized();