|
@@ -432,6 +432,9 @@ bool OBSApp::InitGlobalConfigDefaults()
|
|
|
"CurrentTheme", DEFAULT_THEME);
|
|
"CurrentTheme", DEFAULT_THEME);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ config_set_default_string(globalConfig, "General", "HotkeyFocusType",
|
|
|
|
|
+ "NeverDisableHotkeys");
|
|
|
|
|
+
|
|
|
config_set_default_bool(globalConfig, "BasicWindow",
|
|
config_set_default_bool(globalConfig, "BasicWindow",
|
|
|
"VerticalVolControl", false);
|
|
"VerticalVolControl", false);
|
|
|
|
|
|
|
@@ -699,9 +702,10 @@ bool OBSApp::InitGlobalConfig()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ uint32_t lastVersion =
|
|
|
|
|
+ config_get_int(globalConfig, "General", "LastVersion");
|
|
|
|
|
+
|
|
|
if (!config_has_user_value(globalConfig, "General", "Pre19Defaults")) {
|
|
if (!config_has_user_value(globalConfig, "General", "Pre19Defaults")) {
|
|
|
- uint32_t lastVersion =
|
|
|
|
|
- config_get_int(globalConfig, "General", "LastVersion");
|
|
|
|
|
bool useOldDefaults = lastVersion &&
|
|
bool useOldDefaults = lastVersion &&
|
|
|
lastVersion <
|
|
lastVersion <
|
|
|
MAKE_SEMANTIC_VERSION(19, 0, 0);
|
|
MAKE_SEMANTIC_VERSION(19, 0, 0);
|
|
@@ -712,8 +716,6 @@ bool OBSApp::InitGlobalConfig()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!config_has_user_value(globalConfig, "General", "Pre21Defaults")) {
|
|
if (!config_has_user_value(globalConfig, "General", "Pre21Defaults")) {
|
|
|
- uint32_t lastVersion =
|
|
|
|
|
- config_get_int(globalConfig, "General", "LastVersion");
|
|
|
|
|
bool useOldDefaults = lastVersion &&
|
|
bool useOldDefaults = lastVersion &&
|
|
|
lastVersion <
|
|
lastVersion <
|
|
|
MAKE_SEMANTIC_VERSION(21, 0, 0);
|
|
MAKE_SEMANTIC_VERSION(21, 0, 0);
|
|
@@ -724,8 +726,6 @@ bool OBSApp::InitGlobalConfig()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!config_has_user_value(globalConfig, "General", "Pre23Defaults")) {
|
|
if (!config_has_user_value(globalConfig, "General", "Pre23Defaults")) {
|
|
|
- uint32_t lastVersion =
|
|
|
|
|
- config_get_int(globalConfig, "General", "LastVersion");
|
|
|
|
|
bool useOldDefaults = lastVersion &&
|
|
bool useOldDefaults = lastVersion &&
|
|
|
lastVersion <
|
|
lastVersion <
|
|
|
MAKE_SEMANTIC_VERSION(23, 0, 0);
|
|
MAKE_SEMANTIC_VERSION(23, 0, 0);
|
|
@@ -742,6 +742,16 @@ bool OBSApp::InitGlobalConfig()
|
|
|
changed |= UpdatePre22MultiviewLayout(layout);
|
|
changed |= UpdatePre22MultiviewLayout(layout);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (lastVersion && lastVersion < MAKE_SEMANTIC_VERSION(24, 0, 0)) {
|
|
|
|
|
+ bool disableHotkeysInFocus = config_get_bool(
|
|
|
|
|
+ globalConfig, "General", "DisableHotkeysInFocus");
|
|
|
|
|
+ if (disableHotkeysInFocus)
|
|
|
|
|
+ config_set_string(globalConfig, "General",
|
|
|
|
|
+ "HotkeyFocusType",
|
|
|
|
|
+ "DisableHotkeysInFocus");
|
|
|
|
|
+ changed = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (changed)
|
|
if (changed)
|
|
|
config_save_safe(globalConfig, "tmp", nullptr);
|
|
config_save_safe(globalConfig, "tmp", nullptr);
|
|
|
|
|
|
|
@@ -1227,8 +1237,7 @@ void OBSApp::AppInit()
|
|
|
EnableOSXVSync(false);
|
|
EnableOSXVSync(false);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- enableHotkeysInFocus = !config_get_bool(globalConfig, "General",
|
|
|
|
|
- "DisableHotkeysInFocus");
|
|
|
|
|
|
|
+ UpdateHotkeyFocusSetting(false);
|
|
|
|
|
|
|
|
move_basic_to_profiles();
|
|
move_basic_to_profiles();
|
|
|
move_basic_to_scene_collections();
|
|
move_basic_to_scene_collections();
|
|
@@ -1257,12 +1266,33 @@ static bool StartupOBS(const char *locale, profiler_name_store_t *store)
|
|
|
|
|
|
|
|
inline void OBSApp::ResetHotkeyState(bool inFocus)
|
|
inline void OBSApp::ResetHotkeyState(bool inFocus)
|
|
|
{
|
|
{
|
|
|
- obs_hotkey_enable_background_press(!inFocus || enableHotkeysInFocus);
|
|
|
|
|
|
|
+ obs_hotkey_enable_background_press(
|
|
|
|
|
+ (inFocus && enableHotkeysInFocus) ||
|
|
|
|
|
+ (!inFocus && enableHotkeysOutOfFocus));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void OBSApp::UpdateHotkeyFocusSetting(bool resetState)
|
|
|
|
|
+{
|
|
|
|
|
+ enableHotkeysInFocus = true;
|
|
|
|
|
+ enableHotkeysOutOfFocus = true;
|
|
|
|
|
+
|
|
|
|
|
+ const char *hotkeyFocusType =
|
|
|
|
|
+ config_get_string(globalConfig, "General", "HotkeyFocusType");
|
|
|
|
|
+
|
|
|
|
|
+ if (astrcmpi(hotkeyFocusType, "DisableHotkeysInFocus") == 0) {
|
|
|
|
|
+ enableHotkeysInFocus = false;
|
|
|
|
|
+ } else if (astrcmpi(hotkeyFocusType, "DisableHotkeysOutOfFocus") == 0) {
|
|
|
|
|
+ enableHotkeysOutOfFocus = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (resetState)
|
|
|
|
|
+ ResetHotkeyState(applicationState() == Qt::ApplicationActive);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void OBSApp::EnableInFocusHotkeys(bool enable)
|
|
|
|
|
|
|
+void OBSApp::DisableHotkeys()
|
|
|
{
|
|
{
|
|
|
- enableHotkeysInFocus = enable;
|
|
|
|
|
|
|
+ enableHotkeysInFocus = false;
|
|
|
|
|
+ enableHotkeysOutOfFocus = false;
|
|
|
ResetHotkeyState(applicationState() == Qt::ApplicationActive);
|
|
ResetHotkeyState(applicationState() == Qt::ApplicationActive);
|
|
|
}
|
|
}
|
|
|
|
|
|