Correct timing issue with entry level Auto-Type on some platforms

* Fixes #7584
This commit is contained in:
Jonathan White 2022-03-22 11:40:55 -04:00
parent 75e857bbfc
commit eac60b3228

View File

@ -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.");