From 66d847c04792e707a063c76a70ccfc6445a33e5e Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 9 Jun 2020 17:10:14 -0400 Subject: [PATCH] Fix ignored switches not directly matching last window --- src/executable-switch.cpp | 7 ++++--- src/window-title-switch.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/executable-switch.cpp b/src/executable-switch.cpp index 05fef095..512be7f3 100644 --- a/src/executable-switch.cpp +++ b/src/executable-switch.cpp @@ -178,10 +178,11 @@ void SwitcherData::checkExeSwitch(bool &match, OBSWeakSource &scene, QRegularExpression(s.mExe)) != -1); // True if focus is disabled OR switch is focused bool focus = (!s.mInFocus || isInFocus(s.mExe)); - // True if current window is ignored AND switch matches last window + // True if current window is ignored AND switch equals OR matches last window bool ignore = - (ignored && QString::fromStdString(title).contains( - QRegularExpression(s.mExe))); + (ignored && (title == s.mExe || + QString::fromStdString(title).contains( + QRegularExpression(s.mExe)))); if ((equals || matches) && (focus || ignore)) { match = true; diff --git a/src/window-title-switch.cpp b/src/window-title-switch.cpp index d31e6f80..f3baf143 100644 --- a/src/window-title-switch.cpp +++ b/src/window-title-switch.cpp @@ -294,12 +294,13 @@ void SwitcherData::checkWindowTitleSwitch(bool &match, OBSWeakSource &scene, bool fullscreen = (!s.fullscreen || isFullscreen(s.window)); // True if focus is disabled OR switch is focused bool focus = (!s.focus || isFocused(s.window)); - // True if current window is ignored AND switch matches last window + // True if current window is ignored AND switch equals OR matches last window bool ignore = (ignored && - QString::fromStdString(title).contains( - QRegularExpression( - QString::fromStdString(s.window)))); + (title == s.window || + QString::fromStdString(title).contains( + QRegularExpression( + QString::fromStdString(s.window))))); if (isRunning(s.window) && (fullscreen && (focus || ignore))) { match = true;