mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Add ability to use regex for executable switching
Previously, only exact matches to a window title would switch scenes
This commit is contained in:
@@ -129,7 +129,7 @@ void SwitcherData::checkExeSwitch(bool& match, OBSWeakSource& scene, OBSWeakSour
|
||||
GetProcessList(runningProcesses);
|
||||
for (ExecutableSceneSwitch& s : executableSwitches)
|
||||
{
|
||||
if (runningProcesses.contains(s.mExe))
|
||||
if (runningProcesses.indexOf(QRegularExpression(s.mExe)) != -1)
|
||||
{
|
||||
scene = s.mScene;
|
||||
transition = s.mTransition;
|
||||
|
||||
@@ -295,10 +295,7 @@ bool isInFocus(const QString &exeToCheck)
|
||||
string curWindow;
|
||||
GetCurrentWindowTitle(curWindow);
|
||||
|
||||
return (QString::compare(
|
||||
QString::fromStdString(curWindow),
|
||||
exeToCheck,
|
||||
Qt::CaseInsensitive) == 0) ? true : false;
|
||||
return QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user