mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-24 04:12:32 +08:00
[VCM]Only use File Watchers if module is enabled (#22757)
This commit is contained in:
parent
d50b89262c
commit
150f26731c
@ -311,11 +311,7 @@ void VideoConferenceModule::onMicrophoneConfigurationChanged()
|
||||
}
|
||||
}
|
||||
|
||||
VideoConferenceModule::VideoConferenceModule() :
|
||||
_generalSettingsWatcher{ PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
|
||||
toolbar.scheduleGeneralSettingsUpdate();
|
||||
} },
|
||||
_moduleSettingsWatcher{ PTSettingsHelper::get_module_save_file_location(get_key()), [this] { toolbar.scheduleModuleSettingsUpdate(); } }
|
||||
VideoConferenceModule::VideoConferenceModule()
|
||||
{
|
||||
init_settings();
|
||||
_settingsUpdateChannel =
|
||||
@ -524,6 +520,15 @@ void VideoConferenceModule::enable()
|
||||
{
|
||||
if (!_enabled)
|
||||
{
|
||||
_generalSettingsWatcher = std::make_unique<FileWatcher> (
|
||||
PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
|
||||
toolbar.scheduleGeneralSettingsUpdate();
|
||||
});
|
||||
_moduleSettingsWatcher = std::make_unique<FileWatcher> (
|
||||
PTSettingsHelper::get_module_save_file_location(get_key()), [this] {
|
||||
toolbar.scheduleModuleSettingsUpdate();
|
||||
});
|
||||
|
||||
toggleProxyCamRegistration(true);
|
||||
toolbar.setMicrophoneMute(getMicrophoneMuteState());
|
||||
toolbar.setCameraMute(getVirtualCameraMuteState());
|
||||
@ -572,6 +577,8 @@ void VideoConferenceModule::disable()
|
||||
{
|
||||
if (_enabled)
|
||||
{
|
||||
_generalSettingsWatcher.reset();
|
||||
_moduleSettingsWatcher.reset();
|
||||
toggleProxyCamRegistration(false);
|
||||
if (hook_handle)
|
||||
{
|
||||
|
@ -88,8 +88,8 @@ private:
|
||||
std::optional<SerializedSharedMemory> _imageOverlayChannel;
|
||||
std::optional<SerializedSharedMemory> _settingsUpdateChannel;
|
||||
|
||||
FileWatcher _generalSettingsWatcher;
|
||||
FileWatcher _moduleSettingsWatcher;
|
||||
std::unique_ptr<FileWatcher> _generalSettingsWatcher;
|
||||
std::unique_ptr<FileWatcher> _moduleSettingsWatcher;
|
||||
|
||||
static VideoConferenceSettings settings;
|
||||
static Toolbar toolbar;
|
||||
|
Loading…
Reference in New Issue
Block a user