diff --git a/src/executable-switch.cpp b/src/executable-switch.cpp index f1226076..9a31ae4f 100644 --- a/src/executable-switch.cpp +++ b/src/executable-switch.cpp @@ -154,9 +154,9 @@ void SwitcherData::checkExeSwitch(bool& match, OBSWeakSource& scene, OBSWeakSour bool equals = runningProcesses.contains(s.mExe); // True if executable switch is running (regex) bool matches = (runningProcesses.indexOf(QRegularExpression(s.mExe)) != -1); - // True if focus is disabled OR window in focus + // True if focus is disabled OR switch is focused bool focus = (!s.mInFocus || isInFocus(s.mExe)); - // True if current window is ignored AND executable switch matches last window + // True if current window is ignored AND switch matches last window bool ignore = (ignored && QString::fromStdString(title).contains(QRegularExpression(s.mExe))); if ((equals || matches) && (focus || ignore)) diff --git a/src/headers/advanced-scene-switcher.hpp b/src/headers/advanced-scene-switcher.hpp index 8a990d02..5bc5cae0 100644 --- a/src/headers/advanced-scene-switcher.hpp +++ b/src/headers/advanced-scene-switcher.hpp @@ -152,7 +152,7 @@ int secondsSinceLastInput(); * Executable helper ********************************************************************************/ void GetProcessList(QStringList &processes); -bool isInFocus(const QString &exeToCheck); +bool isInFocus(const QString &executable); /******************************************************************************** * Sceneswitch helper diff --git a/src/headers/utility.hpp b/src/headers/utility.hpp index 2aea243e..c28c92b6 100644 --- a/src/headers/utility.hpp +++ b/src/headers/utility.hpp @@ -46,7 +46,7 @@ static inline QString MakeSwitchNameExecutable(const QString &scene, transition + QStringLiteral("]: ") + value; return QStringLiteral("[") + scene + QStringLiteral(", ") + transition + QStringLiteral("]: ") + value + - QStringLiteral(" (only if window is focused)"); + QStringLiteral(" (only if focused)"); } static inline QString MakeScreenRegionSwitchName(const QString &scene, diff --git a/src/linux/advanced-scene-switcher-nix.cpp b/src/linux/advanced-scene-switcher-nix.cpp index 8d69b2db..af72858e 100644 --- a/src/linux/advanced-scene-switcher-nix.cpp +++ b/src/linux/advanced-scene-switcher-nix.cpp @@ -341,15 +341,15 @@ void GetProcessList(QStringList &processes) } } -bool isInFocus(const QString &exeToCheck) +bool isInFocus(const QString &executable) { - string curWindow; - GetCurrentWindowTitle(curWindow); + string current; + GetCurrentWindowTitle(current); // True if executable switch equals current window - bool equals = (exeToCheck.toStdString() == curWindow); + bool equals = (executable.toStdString() == current); // True if executable switch matches current window - bool matches = QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck)); + bool matches = QString::fromStdString(current).contains(QRegularExpression(executable)); return (equals || matches); } diff --git a/src/osx/advanced-scene-switcher-osx.mm b/src/osx/advanced-scene-switcher-osx.mm index 372e5c63..f3ed34b1 100644 --- a/src/osx/advanced-scene-switcher-osx.mm +++ b/src/osx/advanced-scene-switcher-osx.mm @@ -126,15 +126,15 @@ void GetProcessList(QStringList& list) } } -bool isInFocus(const QString &exeToCheck) +bool isInFocus(const QString &executable) { - string curWindow; - GetCurrentWindowTitle(curWindow); + string current; + GetCurrentWindowTitle(current); // True if executable switch equals current window - bool equals = (exeToCheck.toStdString() == curWindow); + bool equals = (executable.toStdString() == current); // True if executable switch matches current window - bool matches = QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck)); + bool matches = QString::fromStdString(current).contains(QRegularExpression(executable)); return (equals || matches); }