From eac60b3228b936c0d8bb0cb3152f6a721e1c0185 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 22 Mar 2022 11:40:55 -0400 Subject: [PATCH] Correct timing issue with entry level Auto-Type on some platforms * Fixes #7584 --- src/autotype/AutoType.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 850863e9..7764284c 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -297,8 +297,6 @@ void AutoType::executeAutoTypeActions(const Entry* entry, getMainWindow()->minimizeOrHide(); } #endif - QCoreApplication::processEvents(); - window = m_plugin->activeWindow(); } else { // Restore window state (macOS only) then raise the target window restoreWindowState(); @@ -312,6 +310,11 @@ void AutoType::executeAutoTypeActions(const Entry* entry, int delay = qMax(100, config()->get(Config::AutoTypeStartDelay).toInt()); Tools::wait(delay); + // Grab the current active window after everything settles + if (window == 0) { + window = m_plugin->activeWindow(); + } + for (const auto& action : asConst(actions)) { if (m_plugin->activeWindow() != window) { qWarning("Active window changed, interrupting auto-type.");