Fix Auto-Type Empty Window Behavior

* Fixes #9282
* Also improve documentation for window title matching behavior
This commit is contained in:
Jonathan White 2025-11-02 09:40:10 -05:00
parent 6130a64be5
commit ebf0676661
4 changed files with 38 additions and 2 deletions

View file

@ -334,12 +334,15 @@ QList<QString> Entry::autoTypeSequences(const QString& windowTitle) const
};
QList<QString> sequenceList;
QList<QString> emptyWindowSequences;
// Add window association matches
const auto assocList = autoTypeAssociations()->getAll();
for (const auto& assoc : assocList) {
auto window = resolveMultiplePlaceholders(assoc.window);
if (!assoc.window.isEmpty() && windowMatches(window)) {
if (assoc.window.isEmpty()) {
emptyWindowSequences << assoc.sequence;
} else if (windowMatches(window)) {
if (!assoc.sequence.isEmpty()) {
sequenceList << assoc.sequence;
} else {
@ -358,6 +361,11 @@ QList<QString> Entry::autoTypeSequences(const QString& windowTitle) const
sequenceList << effectiveAutoTypeSequence();
}
// If any associations were made, include the empty window associations
if (!sequenceList.isEmpty()) {
sequenceList.append(emptyWindowSequences);
}
return sequenceList;
}