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.
This commit is contained in:
jp9000 2019-07-22 01:17:29 -07:00
parent 9ca1e85f7d
commit 985772d915

View file

@ -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;
}