Add direct matching to window, executable, and ignored switches

Reverts part of commit 5f87a61177

Direct matching occurs in the same loop as regex in order to allow the list order to function as indicated in the UI
This commit is contained in:
Myned
2020-05-17 13:42:50 -04:00
parent f0aa76517a
commit d5052c94ca
3 changed files with 30 additions and 9 deletions

View File

@@ -234,28 +234,36 @@ void SwitcherData::checkWindowTitleSwitch(bool& match, OBSWeakSource& scene, OBS
GetCurrentWindowTitle(title);
for (auto& window : ignoreWindowsSwitches)
{
// True if ignored switch equals title
bool equals = (title == window);
// True if ignored switch matches title
bool matches = QString::fromStdString(title).contains(QRegularExpression(window.c_str()));
if (matches)
if (equals || matches)
{
title = lastTitle;
break;
}
}
lastTitle = title;
// Check for regex match
// Check for match
for (WindowSceneSwitch& s : windowSwitches)
{
// True if window switch equals title
bool equals = (title == s.window);
// True if window switch matches title
bool matches = QString::fromStdString(title).contains(QRegularExpression(s.window.c_str()));
// True if fullscreen is disabled OR window is fullscreen
bool fullscreen = (!s.fullscreen || isFullscreen());
if (matches && fullscreen)
if ((equals || matches) && fullscreen)
{
match = true;
scene = s.scene;
transition = s.transition;
break;
}
}