From 985772d9158cc52ff5cb756e78a087cf5d8ea3d1 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 22 Jul 2019 01:17:29 -0700 Subject: [PATCH] UI: Fix param logic of ResetHotkeyState calls The parameter "inFocus" was being given the opposite of what the name implies: it was being set to false when in focus, and true when not in focus. This fixes that confusion. --- UI/obs-app.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index b086303dc..234e0d60c 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1257,13 +1257,13 @@ static bool StartupOBS(const char *locale, profiler_name_store_t *store) inline void OBSApp::ResetHotkeyState(bool inFocus) { - obs_hotkey_enable_background_press(inFocus || enableHotkeysInFocus); + obs_hotkey_enable_background_press(!inFocus || enableHotkeysInFocus); } void OBSApp::EnableInFocusHotkeys(bool enable) { enableHotkeysInFocus = enable; - ResetHotkeyState(applicationState() != Qt::ApplicationActive); + ResetHotkeyState(applicationState() == Qt::ApplicationActive); } Q_DECLARE_METATYPE(VoidFunc) @@ -1313,9 +1313,9 @@ bool OBSApp::OBSInit() connect(this, &QGuiApplication::applicationStateChanged, [this](Qt::ApplicationState state) { - ResetHotkeyState(state != Qt::ApplicationActive); + ResetHotkeyState(state == Qt::ApplicationActive); }); - ResetHotkeyState(applicationState() != Qt::ApplicationActive); + ResetHotkeyState(applicationState() == Qt::ApplicationActive); return true; }